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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃悰 [relase-0.8] Fix a race condition between leader election and recorder #1381

Merged
merged 2 commits into from Feb 10, 2021

Commits on Feb 10, 2021

  1. 馃悰 Fix a race condition between leader election and recorder

    This change introduces better syncronization between the leader election
    code and the event recorder. Running tests with -race flag, we often saw
    a panic on a closed channel, the channel was the one that the event
    recorder was using internally.
    
    After digging more through the code, it seems that we weren't properly
    waiting for leader election code to stop completely, but instead we were
    only calling the cancel() function asking the leader election to stop.
    
    With this change, during a shutdown, we now wait for leader election to
    finish up any internal task before we return and close an internal
    channel. Only after leader election signals that the channel has been
    closed, and  Run(...) has properly returned, we return execution to the
    stop procedure, where the event recorder is then stopped.
    
    Signed-off-by: Vince Prignano <vincepri@vmware.com>
    vincepri committed Feb 10, 2021
    Copy the full SHA
    fa1ed34 View commit details
    Browse the repository at this point in the history
  2. Only cancel leader election if the runnables have shutdown

    Signed-off-by: Vince Prignano <vincepri@vmware.com>
    vincepri committed Feb 10, 2021
    Copy the full SHA
    faecdc7 View commit details
    Browse the repository at this point in the history