[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-API] [PATCH 0 of 3] Work around race in the domain shutdown code



Work around race in the domain shutdown code.

When we previously changed the code to drop the per-VM mutex when requesting a 
domain shuts itself down (control/shutdown=x) we deliberately made it possible 
for a shutdown via the API to race with a shutdown triggered externally, via 
the event thread. We fixed this by making the destroy code check to see whether 
the domain had already been restarted and retry if so.

Unfortunately (i) we didn't add a delay into the retry loop allowing it to busy 
loop; and (ii) it turns out that calling Xc.domain_shutdown doesn't guarantee 
that subsequent Xc.domain_getinfo calls see the new state-- this triggered the 
retry (busy)loop.

Work around this by adding a 5s delay to the retry loop. Note that this is 
triggered very rarely in my testing: 1000 shutdowns triggered the retry twice.

Signed-off-by: David Scott <dave.scott@xxxxxxxxxxxxx>
2 files changed, 15 insertions(+), 6 deletions(-)
ocaml/xapi/events.ml  |    8 ++++----
ocaml/xapi/xapi_vm.ml |   13 +++++++++++--

_______________________________________________
xen-api mailing list
xen-api@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/mailman/listinfo/xen-api


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.