-
Notifications
You must be signed in to change notification settings - Fork 3
Fix double mutex unlock panic in saveData loop #2132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -115,6 +115,7 @@ func saveData(contractHash string) { | |
| default: | ||
| // Queue is full, skip this one (it will be retried in the next save cycle) | ||
| log.Printf("Save queue full, skipping contract: %s", contractHash) | ||
| delete(pendingSaves, contractHash) // Remove from pending since we couldn't queue it | ||
| saveQueueMutex.Unlock() | ||
| continue | ||
|
Comment on lines
115
to
120
|
||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
delete(pendingSaves, contractHash)in thedefaultbranch is currently a no-op because this branch is only reached when!pendingSaves[contractHash]and the map entry is never set totruebefore theselect. This makes the inline comment misleading and adds confusion. Either remove thedelete(...)and adjust the comment, or setpendingSaves[contractHash]=truebefore attempting to enqueue and onlydelete(...)on enqueue failure.