Skip to content

fix: race in poll timer callback and Stop/Reset - #24

Merged
cmaglie merged 1 commit into
bugst:mainfrom
lucarin91:fix-data-race-tick-func
Oct 13, 2026
Merged

cmaglie merged 1 commit into
bugst:mainfrom
lucarin91:fix-data-race-tick-func

Conversation

@lucarin91

@lucarin91 lucarin91 commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

There is a race condition between the After function update and the call on the Stop/Reset calls on the Timer object.
This could lead to panics if the After function is executed too soon, or to an ineffective timer Stop that will leak the timer past the download.

Propose a raw approach with a goroutine and NewTicker.

The data race issue appears in a test here https://github.com/arduino/arduino-app-cli/actions/runs/38223699768/job/114725904213

@cmaglie
cmaglie merged commit f1d274e into bugst:main Oct 13, 2026
3 checks 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