xm list triggers shutdown refreshing
xm list -> XendDomain:list_sorted() -> XendDomain:list() -> XendDomain:_refresh() -> XendDomainInfo:update(refresh = True)
Surely such non-modifying commands should not be altering state? Why aren't we passing in refresh = False in these cases?
This is a nasty problem if (say) dumpCore fails: every time we try to xm list, then it will 'notice' that the domain is in the crashed state, try to dump core, fail and plop that error back to 'xm list'.
regards
john
Quoted 6 lines · John Levon
xm list -> XendDomain:list_sorted() -> XendDomain:list() -> XendDomain:_refresh() -> XendDomainInfo:update(refresh = True)
Surely such non-modifying commands should not be altering state? Why aren't we passing in refresh = False in these cases?
Yes, you're right, we should. There's a patch on its way.
Quoted 3 lines
This is a nasty problem if (say) dumpCore fails: every time we try to xm list, then it will 'notice' that the domain is in the crashed state, try to dump core, fail and plop that error back to 'xm list'.
This is still a problem, regardless -- that function will be called every time a domain starts or stops, so you will still get multiple attempts to dump core. Could you spin a patch to record the failure in the store, so that we don't try and dump core again?
Ewan.
Quoted 7 lines · Ewan Mellor
Quoted 5 lines
xm list -> XendDomain:list_sorted() -> XendDomain:list() -> XendDomain:_refresh() -> XendDomainInfo:update(refresh = True)
Surely such non-modifying commands should not be altering state? Why aren't we passing in refresh = False in these cases?
Yes, you're right, we should. There's a patch on its way.
Great.
Quoted 8 lines
Quoted 3 lines
This is a nasty problem if (say) dumpCore fails: every time we try to xm list, then it will 'notice' that the domain is in the crashed state, try to dump core, fail and plop that error back to 'xm list'.
This is still a problem, regardless -- that function will be called every time a domain starts or stops, so you will still get multiple attempts to dump core. Could you spin a patch to record the failure in the store, so that we don't try and dump core again?
Hmm, for this specific case, isn't it better to catch the exception from dumpCore and continue? i.e. something like:
if xoptions.get_enable_dump():
try:
self.dumpCore()
except XendError x:
pass
restart_reason = 'crash'
self._stateSet(DOM_STATE_HALTED)
BTW:
def dumpCore(self, corefile = None):
"""Create a core dump for this domain. Nothrow guarantee."""
^^^^^^^^^^^^^^^^^
hmm :)
regards
john
Quoted 18 lines · John Levon
Quoted 8 lines
Quoted 3 lines
This is a nasty problem if (say) dumpCore fails: every time we try to xm list, then it will 'notice' that the domain is in the crashed state, try to dump core, fail and plop that error back to 'xm list'.
This is still a problem, regardless -- that function will be called every time a domain starts or stops, so you will still get multiple attempts to dump core. Could you spin a patch to record the failure in the store, so that we don't try and dump core again?
Hmm, for this specific case, isn't it better to catch the exception from dumpCore and continue? i.e. something like:
if
xoptions.get_enable_dump():
try:
self.dumpCore()
except XendError x:
pass
Quoted 7 lines
restart_reason= 'crash'
self._stateSet(DOM_STATE_HALTED)BTW:
def
dumpCore(self, corefile = None):
"""Create a core dump for this domain. Nothrow guarantee."""
Yes, it looks like someone's committed the heinous crime of breaking this function's guarantees without dealing with the fallout. I shall poke him with a long, sharp stick. And then fix the problem.
Ewan.