Ejemplo n.º 1
0
 def __cbMultiDeleteResults(self, results, newResult):
     for succeed, result in results:
         if not succeed:
             log.notifyFailure(self, result,
                               "Failure waiting admin task '%s' "
                               "components beeing deleted", self.label)
     return newResult
Ejemplo n.º 2
0
 def __bbTaskTerminated(self, resultOrFailure, result):
     if isinstance(resultOrFailure, Failure):
         log.notifyFailure(self, resultOrFailure,
                           "Failure terminating admin task '%s'", self.label)
         self._doTerminated(result)
     else:
         self._doTerminated(resultOrFailure)
Ejemplo n.º 3
0
 def __ebPauseFailed(self, failure):
     log.notifyFailure(self, failure,
                       "Task Manager '%s' failed to pause", self.label)
     if self._state == TaskStateEnum.pausing:
         self._state = TaskStateEnum.started
         self._pauseWaiters.fireErrbacks(failure)
     else:
         self.__stateChangedError(self._pauseWaiters, "pausing")
Ejemplo n.º 4
0
 def __ebGetPropertiesFailed(self, failure, compPxy):
     msg = ("Task manager '%s' fail to retrieve component '%s' properties."
            % (self.label, compPxy.getName()))
     log.notifyFailure(self, failure, "%s", msg)
     self.__apartTasklessComponent(compPxy)
     self._pending -= 1
     self._tryStartup()
     raise admerrs.ComponentRejectedError(msg, cause=failure)
Ejemplo n.º 5
0
 def __ebUIStateFailed(self, failure, compPxy, workerName):
     if not failure.check(ConnectionLost, PBConnectionLost):
         # Do not notify failure because of component crash
         log.notifyFailure(self, failure,
                           "Admin task '%s' failed to retrieve "
                           "component '%s' UI state",
                           self.label, compPxy.getName())
     self.__abortComponentStartup(compPxy)
Ejemplo n.º 6
0
 def __ebComponentLoadFailed(self, failure, componentName, workerName):
     if not failure.check("twisted.spread.pb.PBConnectionLost",
                          "twisted.spread.pb.DeadReferenceError"):
         log.notifyFailure(self, failure,
                           "Admin task '%s' fail to load "
                           "component '%s' on worker '%s'",
                           self.label, componentName, workerName)
     self.__abortComponentStartup()
Ejemplo n.º 7
0
 def _unexpectedError(self, failure):
     """
     Prevents the lost of failure messages.
     Can be use by all child classes when adding
     a callback that is not expected to fail.
     """
     log.notifyFailure(self, failure, "Unexpected Failure")
     #Resolve the failure.
     return
Ejemplo n.º 8
0
 def __ebProfileInitFailed(self, failure, profStore):
     #FIXME: Better Error Handling ?
     log.notifyFailure(self, failure,
                       "Profile '%s' of customer '%s' failed "
                       "to initialize; dropping it",
                       profStore.label, self.label)
     profStore._abort(failure)
     # Don't propagate failures, will be dropped anyway
     return
Ejemplo n.º 9
0
 def _monitorError(self, failure=None, task=None):
     if not failure:
         failure = Failure()
     log.notifyFailure(self, failure,
                       "Monitoring error%s",
                       (task and " during %s" % task) or "",
                       cleanTraceback=True)
     self.setMood(moods.sad)
     return failure
Ejemplo n.º 10
0
 def __ebTargetInitFailed(self, failure, targStore):
     #FIXME: Better Error Handling ?
     log.notifyFailure(self, failure,
                       "Target '%s' of profile '%s' failed "
                       "to initialize; dropping it",
                       targStore.label, self.label)
     targStore._abort(failure)
     # Don't propagate failures, will be dropped anyway
     return
Ejemplo n.º 11
0
 def __ebReportRetrievalFailed(self, failure, transcod_successful):
     if transcod_successful:
         msg = "successful"
     else:
         msg = "failed"
     log.notifyFailure(self, failure, "Failure during retrieving a %s transcoding report" % msg)
     # Not being able to retrieve the report doesn't mean that the
     # transcoding itself failed. Continue with the callback chain.
     return None
Ejemplo n.º 12
0
 def __bbSelectPotentialComponent(self, resultOrFailure):
     if isinstance(resultOrFailure, Failure):
         log.notifyFailure(self, resultOrFailure,
                           "Failure in admin task '%s' during potential "
                           "component selection", self.label)
         compPxys = []
     else:
         compPxys = resultOrFailure
     return self._doSelectPotentialComponent(compPxys)
Ejemplo n.º 13
0
 def __ebAcknowledgeFailed(self, failure, transPxy):
     if not self._isElectedComponent(transPxy):
         return
     if not failure.check("twisted.spread.pb.PBConnectionLost", "flumotion.common.errors.SleepingComponentError"):
         log.notifyFailure(
             self, failure, "Failed to acknowledge task '%s' transcoder '%s'", self.label, transPxy.getName()
         )
     # If the acknowledge fail, the state is unpredictable,
     # so there is no sense to abort and retry.
     self.__transcodingFailed(transPxy)
Ejemplo n.º 14
0
 def _retrievalFailed(self, failure):
     """
     Can be used by child class as retrieval errorback.
     """
     #FIXME: Better Error Handling ?
     log.notifyFailure(self, failure,
                       "Data retrieval failed for %s '%s'",
                       self.__class__.__name__, self.label)
     #Propagate failures
     return failure
Ejemplo n.º 15
0
 def __ebComponentRestorationFailed(self, failure, compPxy):
     if not self.__checkHeldComponentStatus(compPxy):
         return
     log.notifyFailure(self, failure,
                       "Failure during task '%s' restoration of held "
                       "component '%s'", self.label,
                       compPxy.getName())
     self._cancelComponentHold()
     self._abort()
     self._stopComponent(compPxy)
Ejemplo n.º 16
0
 def __cbMultiUIStateResults(self, results):
     newResult = []
     for succeed, result in results:
         if succeed:
             if result != None:
                 newResult.append(result)
         elif not result.check("twisted.internet.error.ConnectionDone"):
             log.notifyFailure(self, result,
                               "Failure waiting admin task '%s' "
                               "components UI State", self.label)
     return newResult
Ejemplo n.º 17
0
 def __cbStartResumeTranscoding(self, result):
     if isinstance(result, Failure) and not result.check(iherrors.TimeoutError):
         log.notifyFailure(self, result, "Failure waiting transcoder set " "to become idle")
     self.log("Free to continue transcoding startup/resuming")
     d = defer.Deferred()
     for task in self.iterTasks():
         d.addCallback(self.__cbAddBalancedTask, task)
     d.addCallback(defer.dropResult, self._balancer.balance)
     d.addErrback(self.__ebStartupResumingFailure)
     d.callback(None)
     return d
Ejemplo n.º 18
0
 def __ebStartupFailed(self, failure, actionDesc):
     log.notifyFailure(self, failure,
                       "Admin task '%s' failed to startup/resume", self.label)
     if self._state == TaskStateEnum.starting:
         self._state = TaskStateEnum.stopped
         self._startWaiters.fireErrbacks(failure)
     elif self._state == TaskStateEnum.resuming:
         self._state = TaskStateEnum.paused
         self._startWaiters.fireErrbacks(failure)
     else:
         self.__stateChangedError(self._startWaiters, actionDesc)
Ejemplo n.º 19
0
 def __transcodingError(self, failure=None, task=None):
     self._fireStatusChanged(TranscoderStatusEnum.error)
     if not failure:
         failure = Failure()
     self.onJobError(failure.getErrorMessage())
     log.notifyFailure(self, failure,
                       "Transocding error%s",
                       (task and " during %s" % task) or "",
                       cleanTraceback=True)
     self.setMood(moods.sad)
     return failure
Ejemplo n.º 20
0
 def _unexpected_error(self, failure=None, task=None):
     if not failure:
         failure = Failure()
     log.notifyFailure(self, failure,
                       "Unexpected error%s",
                       (task and " during %s" % task) or "",
                       cleanTraceback=True)
     m = messages.Error(_(failure.getErrorMessage()),
                        debug=log.getFailureMessage(failure))
     self.addMessage(m)
     return failure
Ejemplo n.º 21
0
 def __move_files_failed(self, failure, monitor_proxy,
                         src_base, dest_base, relFiles):
     try:
         failure.trap(PBConnectionLost, DeadReferenceError)
     except:
         log.notifyFailure(self, failure,
                           "Monitoring task '%s' monitor "
                           "'%s' fail to move files from '%s' to '%s'",
                           self.label, monitor_proxy.getName(), src_base,
                           dest_base)
     # Continue moving files anyway
     self.__async_move_pending_files()
Ejemplo n.º 22
0
 def __unexpectedError(self, failure=None, task=None):
     self._fireStatusChanged(TranscoderStatusEnum.unexpected_error)
     if not failure:
         failure = Failure()
     self.onJobError(failure.getErrorMessage())
     log.notifyFailure(self, failure,
                       "Unexpected error%s",
                       (task and " during %s" % task) or "",
                       cleanTraceback=True)
     m = messages.Error(T_(failure.getErrorMessage()),
                        debug=log.getFailureMessage(failure))
     self.addMessage(m)
     return failure
Ejemplo n.º 23
0
 def __ebRecoverableFailure(self, failure, context, task, result=None):
     # If stopping don't do anything
     if self._isStopping(): return
     context = self.__lookupContext(context, failure)
     if context.reporter.hasFatalError():
         context.debug("Skipping %s because of fatal error during %s"
                      % (task, context.reporter.report.state.name))
         return failure
     context.reporter.addError(failure)
     warMsg = failure.getErrorMessage()
     log.notifyFailure(context, failure, "Recoverable error during %s", task)
     self._fireWarning(context, warMsg)
     # The error is resolved
     return result
Ejemplo n.º 24
0
 def __ebFatalFailure(self, failure, context, task):
     # If stopping don't do anything
     if self._isStopping(): return
     context = self.__lookupContext(context, failure)
     if context.reporter.hasFatalError():
         context.debug("Skipping %s because of fatal error during %s"
                       % (task, context.reporter.report.state.name))
         return failure
     context.reporter.addError(failure)
     errMsg = failure.getErrorMessage()
     context.reporter.setFatalError(errMsg)
     log.notifyFailure(context, failure, "Fatal error during %s", task)
     self._fireError(context, errMsg)
     if not failure.check(FlumotionError):
         raise TranscoderError(errMsg, data=context, cause=failure)
     return failure
Ejemplo n.º 25
0
 def __ebFilesStateUpdateFailed(self, failure):
     self._stateUpdateResult = None
     log.notifyFailure(self, failure,
                       "Failed to update file states")
     self.__updateFilesState()
Ejemplo n.º 26
0
 def fallback_mime_and_checksum_none(self, failure):
     log.notifyFailure(self, failure, "Failure during checksum / mime type")
     return (None, None)
Ejemplo n.º 27
0
 def __ebAcceptFailure(self, failure, compPxy, message):
     log.notifyFailure(self, failure, "%s", message)
Ejemplo n.º 28
0
 def __ebDiagnoseAcknowledgeFail(self, failure):
     log.notifyFailure(self, failure,
                       "Acknowledgment failed",
                       cleanTraceback=True)
     utils.callNext(reactor.stop)
Ejemplo n.º 29
0
 def __ebFailureDiagnosticFailed(self, failure, report, task, transPxy):
     log.notifyFailure(self, failure, "Failure during transcoding failure diagnostic")
     # But we continue like if nothing has append
     self.__notifyTranscodingfailure(None, report, task, transPxy)
Ejemplo n.º 30
0
 def __ebTaskStopFailed(self, failure, task):
     log.notifyFailure(self, failure,
                       "Task Manager '%s' failed to stop task '%s'",
                       self.label, task.label)