Handle mutex.ErrCancelled coming from worker.Stop #7037

Merged
merged 1 commit into from Feb 27, 2017

Conversation

Projects
None yet
3 participants
Member

babbageclunk commented Feb 27, 2017

Description of change

This occurs very occasionally when stopping the uniter after a
successful run of UniterSuite.TestUniterSteadyStateUpgradeRelations.
It happens when the waitHooks step (which acquires and
releases the hook lock) blocks the uniter code from acquiring the lock -
the mutex code loops and delays for 250ms in that case, and it's still
in that delay select when the test closes the abort channel. This makes
the mutex return ErrCancelled which bubbles back up to the test.

QA steps

Running the test under stress would fail after about 20 mins. I left the test running for a couple of hours and didn't see it again. I also changed the resolver.Loopcode to always return ErrCancelled and confirmed that the test would log the error but pass.

Bug reference

Fixes https://bugs.launchpad.net/juju/+bug/1635664

Handle mutex.ErrCancelled coming from worker.Stop
This happens very occasionally when stopping the uniter after a
successful test. It happens when the waitHooks step (which acquires and
releases the hook lock) blocks the uniter code from acquiring the lock -
the mutex code loops and delays for 250ms in that case, and it's still
in that delay select when the test closes the abort channel. This makes
the mutex return ErrCancelled which bubbles back up to the test.
Member

babbageclunk commented Feb 27, 2017

!!build!!

Awesome

Member

babbageclunk commented Feb 27, 2017

$$merge$$

Contributor

jujubot commented Feb 27, 2017

Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju

@jujubot jujubot merged commit 6150b32 into juju:2.1 Feb 27, 2017

1 check passed

github-check-merge-juju Built PR, ran unit tests, and tested LXD deploy. Use !!.*!! to request another build. IE, !!build!!, !!retry!!
Details

@babbageclunk babbageclunk deleted the babbageclunk:uniter-lock-test-fix branch Feb 27, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment