Fix/WC init race condition #261

Merged
fyrchik merged 1 commit from fix/races-in-WC into master 2023-04-19 09:29:08 +00:00
Contributor

Do not use WC's internals in the initialization routines without mode
protection. WC should be able to change its mode even if the initialization
is not finished yet.

Signed-off-by: Pavel Karpy p.karpy@yadro.com

Was hard to reproduce (1/10, i guess). Not a perfect solution but the perfect lies somewhere near WC refactor i guess (without cache, complex async initialization etc).

Do not use WC's internals in the initialization routines without mode protection. WC should be able to change its mode even if the initialization is not finished yet. Signed-off-by: Pavel Karpy <p.karpy@yadro.com> Was hard to reproduce (1/10, i guess). Not a perfect solution but the perfect lies somewhere near WC refactor i guess (without cache, complex async initialization etc).
carpawell self-assigned this 2023-04-17 15:55:03 +00:00
requested reviews from fyrchik, storage-core-developers, storage-core-committers 2023-04-18 07:09:06 +00:00
acid-ant approved these changes 2023-04-18 07:35:42 +00:00
fyrchik reviewed 2023-04-18 07:54:41 +00:00
@ -89,1 +89,4 @@
c.modeMtx.RLock()
_, _ = c.fsTree.Iterate(prm)
c.modeMtx.RUnlock()
Owner

Why not defer?

Why not `defer`?
Author
Contributor

wanted it to unlock as fast as possible, without logging and other (possible in future) things. changed to be deferred

wanted it to unlock as fast as possible, without logging and other (possible in future) things. changed to be deferred
carpawell force-pushed fix/races-in-WC from 1d4601f2f7 to f87f44725a 2023-04-18 14:49:14 +00:00 Compare
dstepanov-yadro approved these changes 2023-04-18 15:27:18 +00:00
fyrchik merged commit 20cd080323 into master 2023-04-19 09:29:08 +00:00
fyrchik deleted branch fix/races-in-WC 2023-04-19 09:29:08 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
4 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-node#261
No description provided.