Skip to content

fix(device): avoid copying sync.Map during manual device reload - #241

Merged
bitxeno merged 1 commit into
bitxeno:masterfrom
YellowNest:fix/manual-device-reload-race
Oct 29, 2026
Merged

bitxeno merged 1 commit into
bitxeno:masterfrom
YellowNest:fix/manual-device-reload-race

Conversation

@YellowNest

@YellowNest YellowNest commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Replacing a used sync.Map during manual-device reload races with concurrent GetDevices calls.

Fix

Use sync.Map.Clear() instead of replacing the map. Add a regression test for concurrent reloads and reads.

Verification

  • GitHub CI passed: frontend tests, build and golangci-lint.
  • Isolated race reproduction confirmed the original failure.
  • Corrected isolated race test passed 200 repetitions.
  • Full Go unit test suite has not been run.

@YellowNest
YellowNest marked this pull request as ready for review October 28, 2026 23:43
@bitxeno
bitxeno merged commit ce7841b into bitxeno:master Oct 29, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

⌂ 换网址