fix(blockstm): remove duplicate unlock in Resume() causing double unlock panic#26214
fix(blockstm): remove duplicate unlock in Resume() causing double unlock panic#26214fx0x55 wants to merge 6 commits intocosmos:mainfrom
Conversation
…ock panic The Resume() method had defer s.Unlock() followed by manual s.Unlock() calls before panic. When panic occurred, the deferred unlock would execute, resulting in a double unlock panic. Remove the redundant condition checks and manual unlock calls since the condition is already checked at the beginning of the function.
|
Thanks for the fix — removing the redundant branches (and the manual There don’t appear to be any targeted tests for
That would lock in the intended semantics and guard against regressions if the early-return guard ever changes. |
Thanks! Added
|
Description
Fixes a critical concurrency bug in
internal/blockstm/status.gowhere theResume()method could cause a double unlock panic.Problem
The
Resume()method had the following issue:defer s.Unlock()at the beginning (line 100)s.Unlock()calls beforepanic()(lines 107-109, 113-115)Changes
Before
After
Testing
All existing tests in
internal/blockstm/...pass: