bug #38453 [lock] Mark Key unserializable whith PgsqlStore (jderusse)

This PR was merged into the 5.x branch.

Discussion
----------

[lock] Mark Key unserializable whith PgsqlStore

| Q             | A
| ------------- | ---
| Branch?       | 5.x
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | /
| License       | MIT
| Doc PR        | /

Marks key unserializable #38395 with the new PgsqlStore #38346

Commits
-------

eb934e9015 Mark Key unserializable whith PgsqlStore
This commit is contained in:
Fabien Potencier 2020-10-07 11:11:18 +02:00
commit 414a5abe78

View File

@ -87,6 +87,7 @@ class PostgreSqlStore implements BlockingSharedLockStoreInterface, BlockingStore
// Check if lock is acquired
if (true === (\is_object($result) ? $result->fetchOne() : $stmt->fetchColumn())) {
$key->markUnserializable();
// release sharedLock in case of promotion
$this->unlockShared($key);
@ -109,6 +110,7 @@ class PostgreSqlStore implements BlockingSharedLockStoreInterface, BlockingStore
// Check if lock is acquired
if (true === (\is_object($result) ? $result->fetchOne() : $stmt->fetchColumn())) {
$key->markUnserializable();
// release lock in case of demotion
$this->unlock($key);