def _kickGC(self): # don't bother if an instance already running (this is just an # optimization to reduce the overhead of forking a new process if we # don't have to, but the process will check the lock anyways) lockRunning = Lock(cleanup.LOCK_TYPE_RUNNING, self.uuid) if not lockRunning.acquireNoblock(): if cleanup.should_preempt(self.session, self.uuid): util.SMlog( "Aborting currently-running coalesce of garbage VDI") try: if not cleanup.abort(self.uuid, soft=True): util.SMlog("The GC has already been scheduled to " "re-start") except util.CommandException as e: if e.code != errno.ETIMEDOUT: raise util.SMlog('failed to abort the GC') finally: return else: util.SMlog("A GC instance already running, not kicking") return else: lockRunning.release() util.SMlog("Kicking GC") cleanup.gc(self.session, self.uuid, True)
def _kickGC(self): # don't bother if an instance already running (this is just an # optimization to reduce the overhead of forking a new process if we # don't have to, but the process will check the lock anyways) lockRunning = Lock(cleanup.LOCK_TYPE_RUNNING, self.uuid) if not lockRunning.acquireNoblock(): if cleanup.should_preempt(self.session, self.uuid): util.SMlog("Aborting currently-running coalesce of garbage VDI") try: if not cleanup.abort(self.uuid, soft=True): util.SMlog("The GC has already been scheduled to " "re-start") except util.CommandException, e: if e.code != errno.ETIMEDOUT: raise util.SMlog("failed to abort the GC") finally:
def _kickGC(self): # don't bother if an instance already running (this is just an # optimization to reduce the overhead of forking a new process if we # don't have to, but the process will check the lock anyways) lockRunning = Lock(cleanup.LOCK_TYPE_RUNNING, self.uuid) if not lockRunning.acquireNoblock(): if cleanup.should_preempt(self.session, self.uuid): util.SMlog("Aborting currently-running coalesce of garbage VDI") cleanup.abort(self.uuid) else: util.SMlog("A GC instance already running, not kicking") return else: lockRunning.release() util.SMlog("Kicking GC") cleanup.gc(self.session, self.uuid, True)
def _kickGC(self): # don't bother if an instance already running (this is just an # optimization to reduce the overhead of forking a new process if we # don't have to, but the process will check the lock anyways) lockRunning = Lock(cleanup.LOCK_TYPE_RUNNING, self.uuid) if not lockRunning.acquireNoblock(): if cleanup.should_preempt(self.session, self.uuid): util.SMlog( "Aborting currently-running coalesce of garbage VDI") cleanup.abort(self.uuid) else: util.SMlog("A GC instance already running, not kicking") return else: lockRunning.release() util.SMlog("Kicking GC") cleanup.gc(self.session, self.uuid, True)