Skip to content

Fix a data race between Conn creation and its automatic closing#291

Merged
jsouthworth merged 1 commit intogodbus:masterfrom
ibazhitov:fix-data-race
Jan 4, 2022
Merged

Fix a data race between Conn creation and its automatic closing#291
jsouthworth merged 1 commit intogodbus:masterfrom
ibazhitov:fix-data-race

Conversation

@ibazhitov
Copy link
Contributor

go test -race . detects a data race when a Conn instance is automatically
closed when the provided context's deadline is missed.

Fix the data race by launching the corresponding goroutine only after all
Conn's fields had been initialized.

`go test -race .` detects a data race when a Conn instance is automatically
closed when the provided context's deadline is missed.

Fix the data race by launching the corresponding goroutine only after all
Conn's fields had been initialized.
@jsouthworth jsouthworth merged commit e3cfec0 into godbus:master Jan 4, 2022
@jsouthworth
Copy link
Member

Looks good, thanks!

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