instance: avoid race condition in _list_domains, add _find_domain
ClosedPublic

Authored by kparal on Feb 17 2017, 3:22 PM.

Details

Summary

testcloud was crashing when an instance was destroyed by a third-party
after it has been listed but before its state was queried. This patch
ignores such occurence instead of crashing.

There's a new function _find_domain which is more useful when stopping
or removing an instance - we don't need to query through all existing
instances, instead just access exactly the one we want.

Test Plan

test suite passes (but that's not worth much:)), I also tried manually creating an instance, listing all instances, stopping it, and removing it. More extensive testing is welcome. Using this from libtaskotron with --libvirt also seems fine.

Diff Detail

Repository
rTCLOUD testcloud
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
kparal retitled this revision from to instance: avoid race condition in _list_domains, add _find_domain.Feb 17 2017, 3:22 PM
kparal updated this object.
kparal edited the test plan for this revision. (Show Details)
kparal added reviewers: testcloud, tflink, mkrizek, roshi.
kparal edited the test plan for this revision. (Show Details)Feb 17 2017, 3:35 PM
tflink accepted this revision.Feb 17 2017, 3:52 PM

looks good to me, sensible change in how testcloud works

This revision is now accepted and ready to land.Feb 17 2017, 3:52 PM
This revision was automatically updated to reflect the committed changes.