Skip to content

Commit

Permalink
Add locked request url to logged warning when concurrency exceeded.
Browse files Browse the repository at this point in the history
  • Loading branch information
colinmollenhour committed Dec 29, 2023
1 parent 3d3e497 commit 47a1df3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Cm/RedisSession/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -512,12 +512,12 @@ public function read($sessionId)
// Overloaded sessions get 503 errors
$this->_redis->hIncrBy($sessionId, 'wait', -1);
$this->_sessionWritten = true; // Prevent session from getting written
$writes = $this->_redis->hGet($sessionId, 'writes');
[$writes, $lockedRequestUrl] = $this->_redis->hMGet($sessionId, ['writes','req']);
$this->_log(
sprintf(
'Session concurrency exceeded for ID %s; displaying HTTP 503 (%s waiting, %s total '
. 'requests)',
$sessionId, $waiting, $writes
. 'requests) - Locked URL: %s',
$sessionId, $waiting, $writes, $lockedRequestUrl
),
LoggerInterface::WARNING
);
Expand Down

5 comments on commit 47a1df3

@hostep
Copy link

@hostep hostep commented on 47a1df3 Feb 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @colinmollenhour, given that this code was recently updated and more and more people are reporting issues on line 515 of this class, could it be that there might be a bug here?
We also have seen this same problem recently, occassionaly happening in magento log files (using v1.5.4 of this module, using Redis 7.0.10 and using Magento 2.4.6-p3), but I haven't gotten the opportunity to reproduce or debug it yet.

@colinmollenhour
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yikes,. there is definitely a bug... I just pushed a fix at 5d93866

@hostep
Copy link

@hostep hostep commented on 47a1df3 Feb 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, thanks! We'll give this newest version a try next week.

@mokadev
Copy link
Contributor

@mokadev mokadev commented on 47a1df3 Mar 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi

i have this version but still got the error. Anything else that i possibly missed?

@hostep
Copy link

@hostep hostep commented on 47a1df3 Mar 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In our case it was solved by upgrading to version v1.5.5 ...

Please sign in to comment.