Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix potential races in createWaitForEvent* #1391

Merged
merged 1 commit into from
Jul 1, 2024
Merged

Fix potential races in createWaitForEvent* #1391

merged 1 commit into from
Jul 1, 2024

Conversation

mstoykov
Copy link
Contributor

What?

Try to prevent blocking on channel send.

Why?

It is possible (and noticed in the real world) that the goroutine might enter the out select and then by the time get to writing to the channel back for the event handling to have been canceled.

Checklist

  • I have performed a self-review of my code
  • I have added tests for my changes
  • I have commented on my code, particularly in hard-to-understand areas

Related PR(s)/Issue(s)

@andrewslotin andrewslotin requested review from andrewslotin and removed request for ankur22 June 27, 2024 10:04
Copy link
Contributor

@andrewslotin andrewslotin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch 👍

Copy link
Member

@inancgumus inancgumus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch 👍

It is possible (and noticed in the real world) that the goroutine might
enter the out select and then by the time get to writing to the channel
back for the event handling to have been canceled.
@mstoykov mstoykov merged commit 29f6ef3 into main Jul 1, 2024
23 checks passed
@mstoykov mstoykov deleted the raceFixes branch July 1, 2024 10:57
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.

3 participants