What are the Slack Archives?

It’s a history of our time together in the Slack Community! There’s a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.

Because this space is not active, you won’t be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..

Hi Guys, maybe someone can help me to understand what happened in our production server.. We have s

giovanni.piemontese
giovanni.piemontese Spryker Solution Partner Posts: 871 🧑🏻‍🚀 - Cadet

Hi Guys, maybe someone can help me to understand what happened in our production server..

We have since yesterday a lot of SessionHandlerRedisLocking Exception..

Yves.CRITICAL: Spryker\Shared\SessionRedis\Handler\Exception\LockCouldNotBeAcquiredException - Spryker\Shared\SessionRedis\Handler\SessionHandlerRedisLocking could not acquire access to the session 5b13e03e40f2f4ad90c2eeabcc4d60d8 in "/srv/www/production/htdocs/current/vendor/spryker/session-redis/src/Spryker/Shared/SessionRedis/Handler/SessionHandlerRedisLocking.php::97" {"exception":"[object] (Spryker\\Shared\\SessionRedis\\Handler\\Exception\\LockCouldNotBeAcquiredException(code: 0): Spryker\\Shared\\SessionRedis\\Handler\\SessionHandlerRedisLocking could not acquire access to the session 5b13e03e40f2f4ad90c2eeabcc4d60d8 at /srv/www/production/htdocs/current/vendor/spryker/session-redis/src/Spryker/Shared/SessionRedis/Handler/SessionHandlerRedisLocking.php:97)

Redis Server seems to be ok and running. No log.. No downtime..

Why YVES can not lock the customer session in redis before it fetch the customer session data? What can be the possible reasons of this exception?

Thank u in advance for helping me to find out the problem!

Comments

  • UQ958DA4U
    UQ958DA4U Posts: 232 🧑🏻‍🚀 - Cadet

    This happens when two concurrent requests are running and the first one of them is taking longer than the lock timeout.
    Every request locks the user's session, so it's as the exception mentions: This time, the lock could not be required because it wasn't released in a timely manner.

    The session is locked to avoid race conditions.

  • UQ958DA4U
    UQ958DA4U Posts: 232 🧑🏻‍🚀 - Cadet

    One hint if you're hosting in the cloud: Take a look at your IOPS and your PHP timeouts. It might well be that some processes in Twig are too slow (for example scanning the file system).

  • giovanni.piemontese
    giovanni.piemontese Spryker Solution Partner Posts: 871 🧑🏻‍🚀 - Cadet
    edited November 2020

    Ok, thanks for replies...

    We have now (ca. 1 hour ago) just restarted the redis service (located in own server behind LB) with ca. 19gb redis data and after restart it seems to be gone the problem/exception...

    But we did not have any redis log info to suspect something... We will take an intensive look in log to see if the problem come again or not..

    What u suggest about RAM and CPU for redis, taking care that we have now ca. 19 gb of redis data in ram and 2 CPU and 24gb ram running and a lot lot lot of requests?

    It can maybe be that was a server/service problem that own limit was reached or not? (as already said no log in redis)

  • UQ958DA4U
    UQ958DA4U Posts: 232 🧑🏻‍🚀 - Cadet

    Again, your problem is probably a race of some sort. Of course, if you restart Redis, the locks are all reset and the problem is "gone".

  • giovanni.piemontese
    giovanni.piemontese Spryker Solution Partner Posts: 871 🧑🏻‍🚀 - Cadet

    Yes. u are right Thomas.. We will separate KV-Storage from Session-Redis to avoid this problem again.. The suspect was that due permanently session lock and write the redis cannot more lock every request und it happened always during RDB-Dump...