Beispiel #1
0
    def can_terminate(self, run_id):
        check.str_param(run_id, "run_id")

        client = self._get_grpc_client_for_termination(run_id)
        if not client:
            return False

        res = client.can_cancel_execution(
            CanCancelExecutionRequest(run_id=run_id))

        return res.can_cancel
Beispiel #2
0
    def can_terminate(self, run_id):
        check.str_param(run_id, 'run_id')

        if run_id not in self._run_id_to_repository_location_handle_cache:
            return False

        res = self._run_id_to_repository_location_handle_cache[
            run_id].client.can_cancel_execution(
                CanCancelExecutionRequest(run_id=run_id))

        return res.can_cancel
Beispiel #3
0
    def can_terminate(self, run_id):
        check.str_param(run_id, "run_id")

        client = self._get_grpc_client_for_termination(run_id)
        if not client:
            return False

        try:
            res = client.can_cancel_execution(CanCancelExecutionRequest(run_id=run_id), timeout=5)
        except grpc._channel._InactiveRpcError:  # pylint: disable=protected-access
            # Server that created the run may no longer exist
            return False

        return res.can_cancel
Beispiel #4
0
    def can_terminate(self, run_id):
        check.str_param(run_id, "run_id")

        client = self._get_grpc_client_for_termination(run_id)
        if not client:
            return False

        try:
            res = deserialize_json_to_dagster_namedtuple(
                client.can_cancel_execution(
                    CanCancelExecutionRequest(run_id=run_id), timeout=5))
        except DagsterUserCodeUnreachableError:
            # Server that created the run may no longer exist
            return False

        return res.can_cancel