8000 minor #32075 [Lock] Fix expired lock not cleaned in ZooKeeper (jderusse) · symfony/symfony@5af1e9e · GitHub
[go: up one dir, main page]

Skip to content

Commit 5af1e9e

Browse files
minor #32075 [Lock] Fix expired lock not cleaned in ZooKeeper (jderusse)
This PR was merged into the 4.3 branch. Discussion ---------- [Lock] Fix expired lock not cleaned in ZooKeeper | Q | A | ------------- | --- | Branch? | 4.3 | Bug fix? | yes | New feature? | ,p | BC breaks? | no <!-- see https://symfony.com/bc --> | Deprecations? | no | Tests pass? | yes | Fixed tickets | #31426 | License | MIT | Doc PR | NA Following #32071 for 4.3 branch context: When a lock is acquired BUT not as fast as expected, a LockExpiredException is thrown. Issue is, that the lock is not removed which avoid other process to acquire that lock. This PR clean state of store when a LockExpiredException is triggered in PDO and ZooKeepeer. Commits ------- 4f808ef Fix Expiring lock in PDO and ZooKeeper
2 parents 15652e3 + 4f808ef commit 5af1e9e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Symfony/Component/Lock/Store/ZookeeperStore.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
*/
2626
class ZookeeperStore implements StoreInterface
2727
{
28+
use ExpiringStoreTrait;
29+
2830
private $zookeeper;
2931

3032
public function __construct(\Zookeeper $zookeeper)
@@ -45,6 +47,8 @@ public function save(Key $key)
4547
$token = $this->getUniqueToken($key);
4648

4749
$this->createNewLock($resource, $token);
50+
51+
$this->checkNotExpired($key);
4852
}
4953

5054
/**

0 commit comments

Comments
 (0)
0