Skip to content

Commit 58e3285

Browse files
committed
minor #21578 [Lock] Explain 'retry' of lock stores over explicit 'no' (rvanlaak)
This PR was submitted for the 7.3 branch but it was squashed and merged into the 6.4 branch instead. Discussion ---------- [Lock] Explain 'retry' of lock stores over explicit 'no' The documented 'no' is quite explicit with regards to whether a store does not allow userland to use the lock's blocking behavior. Using 'retry' as more subtle wording, and reiterating the rationale behind retry below the table, explains that it's the lock class itself that handles blocking support. Seeing the 'no' in the docs shocked me a bit, as it made me doubt many of the implementation I've made that leverage the lock's blocking behaviour. This PR makes the shock a bit more subtle. <!-- If your pull request fixes a BUG, use the oldest maintained branch that contains the bug (see https://symfony.com/releases for the list of maintained branches). If your pull request documents a NEW FEATURE, use the same Symfony branch where the feature was introduced (and `7.x` for features of unreleased versions). --> Commits ------- 46403c4 [Lock] Explain 'retry' of lock stores over explicit 'no'
2 parents 2b87932 + 46403c4 commit 58e3285

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

components/lock.rst

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -390,17 +390,20 @@ The component includes the following built-in store types:
390390
Store Scope Blocking Expiring Sharing Serialization
391391
========================================================== ====== ======== ======== ======= =============
392392
:ref:`FlockStore <lock-store-flock>` local yes no yes no
393-
:ref:`MemcachedStore <lock-store-memcached>` remote no yes no yes
394-
:ref:`MongoDbStore <lock-store-mongodb>` remote no yes no yes
395-
:ref:`PdoStore <lock-store-pdo>` remote no yes no yes
396-
:ref:`DoctrineDbalStore <lock-store-dbal>` remote no yes no yes
393+
:ref:`MemcachedStore <lock-store-memcached>` remote retry yes no yes
394+
:ref:`MongoDbStore <lock-store-mongodb>` remote retry yes no yes
395+
:ref:`PdoStore <lock-store-pdo>` remote retry yes no yes
396+
:ref:`DoctrineDbalStore <lock-store-dbal>` remote retry yes no yes
397397
:ref:`PostgreSqlStore <lock-store-pgsql>` remote yes no yes no
398398
:ref:`DoctrineDbalPostgreSqlStore <lock-store-dbal-pgsql>` remote yes no yes no
399-
:ref:`RedisStore <lock-store-redis>` remote no yes yes yes
399+
:ref:`RedisStore <lock-store-redis>` remote retry yes yes yes
400400
:ref:`SemaphoreStore <lock-store-semaphore>` local yes no no no
401-
:ref:`ZookeeperStore <lock-store-zookeeper>` remote no no no no
401+
:ref:`ZookeeperStore <lock-store-zookeeper>` remote retry no no no
402402
========================================================== ====== ======== ======== ======= =============
403403

404+
When the store does not support blocking locks, the Lock class will retry to acquire
405+
the lock in a non-blocking way until the lock is acquired.
406+
404407
.. tip::
405408

406409
A special ``InMemoryStore`` is available for saving locks in memory during

0 commit comments

Comments
 (0)