pool: Fix panic that causes mutex deadlock #326

Merged
alexvanin merged 2 commits from alexvanin/frostfs-sdk-go:fix/tree-pool-panic into master 2025-01-30 06:57:44 +00:00
Owner

Two concurrent 'deleteClientFromMap' calls for
the same client may produce panic and deadlock.

First goroutine acquires lock, removes element
from the map, releases lock.

Second goroutine acquires lock, and throws panic
while trying to call 'close()' on empty struct.
Lock is never released and it causes deadlock for
other goroutines.

Two concurrent 'deleteClientFromMap' calls for the same client may produce panic and deadlock. First goroutine acquires lock, removes element from the map, releases lock. Second goroutine acquires lock, and throws panic while trying to call 'close()' on empty struct. Lock is never released and it causes deadlock for other goroutines.
alexvanin added 2 commits 2025-01-29 17:14:29 +00:00
Two concurrent 'deleteClientFromMap' calls for
the same client may produce panic and deadlock.

First goroutine acquires lock, removes element
from the map, releases lock.

Second goroutine acquires lock, and throws panic
while trying to call 'close()' on empty struct.
Lock is never released and it causes deadlock for
other goroutines.

Signed-off-by: Alex Vanin <a.vanin@yadro.com>
[#xxx] pool: Add test for concurrent client deletion
Some checks failed
DCO / DCO (pull_request) Failing after 30s
Code generation / Generate proto (pull_request) Successful in 35s
Tests and linters / Tests (pull_request) Successful in 45s
Tests and linters / Lint (pull_request) Successful in 2m17s
46213d1f17
Signed-off-by: Alex Vanin <a.vanin@yadro.com>
requested reviews from storage-core-committers, storage-core-developers, storage-services-committers, storage-services-developers 2025-01-29 17:14:29 +00:00
alexvanin force-pushed fix/tree-pool-panic from 46213d1f17 to 3bae770c93 2025-01-29 17:15:22 +00:00 Compare
alexvanin force-pushed fix/tree-pool-panic from 3bae770c93 to 2786fadb25 2025-01-29 17:17:08 +00:00 Compare
nzinkevich approved these changes 2025-01-30 05:31:09 +00:00
dkirillov approved these changes 2025-01-30 06:05:12 +00:00
alexvanin merged commit 2786fadb25 into master 2025-01-30 06:57:44 +00:00
alexvanin deleted branch fix/tree-pool-panic 2025-01-30 06:57:49 +00:00
Sign in to join this conversation.
No reviewers
TrueCloudLab/storage-core-committers
TrueCloudLab/storage-core-developers
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: TrueCloudLab/frostfs-sdk-go#326
No description provided.