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

worker/terminationworker: fix test hang #5528

Merged
merged 2 commits into from
Jun 3, 2016
Merged

worker/terminationworker: fix test hang #5528

merged 2 commits into from
Jun 3, 2016

Commits on Jun 3, 2016

  1. rename receiver to w

    davecheney committed Jun 3, 2016
    Configuration menu
    Copy the full SHA
    41a58b1 View commit details
    Browse the repository at this point in the history
  2. worker/terminationworker: fix test hang`

    Fixes LP 1588135
    
    Fix a race on the ownership of the abort signal.
    
    The TestSignal test attempts to see if sending the SIGABRT to the test
    binary itself will cause the worker to unblock itself and exit as
    exited. However, as the original author discovered there is a race
    between sending the signal and the worker spawned from NewWorker
    registering a handler to catch SIGABRT. If the hander was not registered
    in time the SIGABRT would cause the test process to exit.
    
    To fix this problem they set up a SIGABRT handler in SetUpTest to ensure
    that SIGABRT was always handled. However this meant that if NewWorker's
    handler was not registered in time to catch the signal, it would be
    delivered to the channel registed by SetUpTest, causing the test binary
    to hang.
    
    The fix is to remove the SetUpTest workaround and ensure the handler is
    always registered before spawning the loop goroutine so the caller is
    assured that once NewWorker has returned, the handler is in place and it
    is safe to send the signal.
    
    This PR also removes unnecessary use of testing.BaseSuite.
    davecheney committed Jun 3, 2016
    Configuration menu
    Copy the full SHA
    0c9be1c View commit details
    Browse the repository at this point in the history