Files
nats-server/locksordering.txt
Derek Collison 80db7a22ab Optimizations for large single hub account leafnode fleets.
Added a leafnode lock to allow better traversal without copying of large leafnodes in a single hub account.

Signed-off-by: Derek Collison <derek@nats.io>
2023-05-05 13:14:49 -07:00

17 lines
655 B
Plaintext

Here is the list of some established lock ordering.
In this list, A -> B means that you can have A.Lock() then B.Lock(), not the opposite.
jetStream -> jsAccount -> Server -> client -> Account
jetStream -> jsAccount -> stream -> consumer
A lock to protect jetstream account's usage has been introduced: jsAccount.usageMu.
This lock is independent and can be invoked under any other lock: jsAccount -> jsa.usageMu, stream -> jsa.usageMu, etc...
A lock to protect the account's leafnodes list was also introduced to
allow that lock to be held and the acquire a client lock which is not
possible with the normal account lock.
accountLeafList -> client