Esempio n. 1
0
    def __exit__(self, exc_type, exc_value, traceback):
        self._context_guard = False

        # Exiting due to exception, return to allow exception to bubble
        if exc_type or exc_value or traceback:
            return

        # Requested termination is the only time we should be exiting incomplete without an exception
        if not self.is_complete:
            pending_action = (self._executable + self._pending_abandon +
                              self._pending_retry + self._pending_skip)
            raise DagsterIncompleteExecutionPlanError(
                "Execution of pipeline finished without completing the execution plan, "
                "likely as a result of a termination request."
                "{pending_str}{in_flight_str}{action_str}{retry_str}".format(
                    in_flight_str="\nSteps still in flight: {}".format(
                        self._in_flight) if self._in_flight else "",
                    pending_str="\nSteps pending processing: {}".format(
                        self._pending.keys()) if self._pending else "",
                    action_str="\nSteps pending action: {}".format(
                        pending_action) if pending_action else "",
                    retry_str="\nSteps waiting to retry: {}".format(
                        self._waiting_to_retry.keys())
                    if self._waiting_to_retry else "",
                ))

        # See verify_complete - steps for which we did not observe a failure/success event are in an unknown
        # state so we raise to ensure pipeline failure.
        if len(self._unknown_state) > 0:
            raise DagsterUnknownStepStateError(
                "Execution of pipeline exited with steps {step_list} in an unknown state to this process.\n"
                "This was likely caused by losing communication with the process performing step execution."
                .format(step_list=self._unknown_state))
Esempio n. 2
0
    def __exit__(self, exc_type, exc_value, traceback):
        self._context_guard = False

        # Exiting due to exception, return to allow exception to bubble
        if exc_type or exc_value or traceback:
            return

        if not self.is_complete:
            pending_action = (self._executable + self._pending_abandon +
                              self._pending_retry + self._pending_skip)
            state_str = "{pending_str}{in_flight_str}{action_str}{retry_str}".format(
                in_flight_str="\nSteps still in flight: {}".format(
                    self._in_flight) if self._in_flight else "",
                pending_str="\nSteps pending processing: {}".format(
                    self._pending.keys()) if self._pending else "",
                action_str="\nSteps pending action: {}".format(pending_action)
                if pending_action else "",
                retry_str="\nSteps waiting to retry: {}".format(
                    self._waiting_to_retry.keys())
                if self._waiting_to_retry else "",
            )
            if self._interrupted:
                raise DagsterExecutionInterruptedError(
                    f"Execution was interrupted before completing the execution plan. {state_str}"
                )
            else:
                raise DagsterInvariantViolationError(
                    f"Execution finished without completing the execution plan. {state_str}"
                )

        # See verify_complete - steps for which we did not observe a failure/success event are in an unknown
        # state so we raise to ensure pipeline failure.
        if len(self._unknown_state) > 0:
            if self._interrupted:
                raise DagsterExecutionInterruptedError(
                    "Execution exited with steps {step_list} in an unknown state after "
                    "being interrupted.".format(step_list=self._unknown_state))
            else:
                raise DagsterUnknownStepStateError(
                    "Execution exited with steps {step_list} in an unknown state to this process.\n"
                    "This was likely caused by losing communication with the process performing step execution."
                    .format(step_list=self._unknown_state))
Esempio n. 3
0
    def __exit__(self, exc_type, exc_value, traceback):
        self._context_guard = False

        # Exiting due to exception, return to allow exception to bubble
        if exc_type or exc_value or traceback:
            return

        # Requested termination is the only time we should be exiting incomplete without an exception
        if not self.is_complete:
            raise DagsterIncompleteExecutionPlanError(
                "Execution of pipeline finished without completing the execution plan, "
                "likely as a result of a termination request.")

        # See verify_complete - steps for which we did not observe a failure/success event are in an unknown
        # state so we raise to ensure pipeline failure.
        if self.is_complete and len(self._unknown_state) > 0:
            raise DagsterUnknownStepStateError(
                "Execution of pipeline exited with steps {step_list} in an unknown state to this process.\n"
                "This was likely caused by losing communication with the process performing step execution."
                .format(step_list=self._unknown_state))