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

frontend/udp: ensure race-free shutdown #618

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mrd0ll4r
Copy link
Member

@mrd0ll4r mrd0ll4r commented May 1, 2023

Fixes #608

New mechanism to shut down cleanly:

  1. closing is closed, only once, guarded by the mutex.
  2. Socket read deadline is set, which ensures that serve eventually restarts its loop and realizes we're closing.
  3. serve closes serveShutdown when it returns.
  4. serveShutdown signals Stop that serve has returned and no more calls to f.wg.Add can be made.
    5. f.wg.Wait is called, which should be race-free now.

Hope that make sense.
Also, some cleanup with where f.wg.Add is called.
Also, this should hopefully finally fix the flaky CI and allow us to merge a bunch of PRs, maybe.

@mrd0ll4r
Copy link
Member Author

@jzelinskie 👉 👈

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.

Data Race in UDP Frontend
1 participant