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 two races #4301

Merged
merged 2 commits into from
Oct 10, 2020
Merged

Fix two races #4301

merged 2 commits into from
Oct 10, 2020

Commits on Oct 10, 2020

  1. fix a race in the sync manager

    1. SyncerState contains a mutex and should never be copied. Honestly, this case
    was probably fine but it's just as easy to create a separate snapshot type and
    easier to reason about.
    
    2. We need to initialize the syncStates array once at start, before accessing
    it. By each syncer state inside each worker, we were racing with calls to
    `State()`. Again, this was probably benign, but I don't trust optimizing
    compilers.
    Stebalien committed Oct 10, 2020
    Configuration menu
    Copy the full SHA
    7245ac2 View commit details
    Browse the repository at this point in the history
  2. fix a race and optimize hello messages

    LifecycleCtx can _only_ be called during startup as it appends an fx hook.
    Worse, this was causing us to append an fx hook on every single hello message,
    leaking memory (and probably causing other shutdown issues...).
    Stebalien committed Oct 10, 2020
    Configuration menu
    Copy the full SHA
    c463582 View commit details
    Browse the repository at this point in the history