mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-02 03:38:42 -07:00
There was a lock inversion but low risk since it happened during server initialization. Still fixed it and added the ordering in locksordering.txt file. Also fixed multiple lock inversions that were caused by tests. Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
19 lines
749 B
Plaintext
19 lines
749 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
|
|
|
|
AccountResolver interface has various implementations, but assume: AccountResolver -> Server
|