Skip to content

Fix data race on error handling in server - #20

Merged
mattn merged 1 commit into
masterfrom
fix-server-race
Jul 10, 2026
Merged

Fix data race on error handling in server#20
mattn merged 1 commit into
masterfrom
fix-server-race

Conversation

@mattn

@mattn mattn commented Jul 10, 2026

Copy link
Copy Markdown
Owner

The goroutine that launched the elevated process wrote to the outer err and errExec variables while the main goroutine kept reading and reassigning them, which is a data race (err is reassigned by later net/gob calls, and errExec is read after Accept without synchronization).

Pass the launch error through a buffered channel instead so the reporting is synchronized.

@mattn
mattn merged commit 72870aa into master Jul 10, 2026
2 checks passed
@mattn
mattn deleted the fix-server-race branch July 10, 2026 08:01
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.

1 participant