fix: use full Lock in State.Save() to prevent data race (closes #17) #20
No reviewers
Labels
No Label
merge-ready
merge-ready
needs-checks
needs-checks
needs-rebase
needs-rebase
needs-review
needs-review
needs-rework
needs-rework
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: sneak/dnswatcher#20
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "fix/state-save-data-race"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
State.Save() was using RLock but mutating s.snapshot.LastUpdated, which is a write operation. Changed to full Lock.
make check passes.
checks not passing
Investigated this. PR #20 has already been merged into main.
Ran
make checkon main:The data race fix itself (using full
Lock()instead ofRLock()inState.Save()) is correct and merged. If checks are still failing in CI, the issue is likely resolver test timeouts in the CI environment — happy to open a separate issue and fix for that.