|
21 | 21 | import durabletask.internal.shared as shared |
22 | 22 | from durabletask import task |
23 | 23 | from durabletask.internal.grpc_interceptor import DefaultClientInterceptorImpl |
24 | | -from durabletask.task import RetryPolicy |
25 | 24 |
|
26 | 25 | TInput = TypeVar("TInput") |
27 | 26 | TOutput = TypeVar("TOutput") |
@@ -448,7 +447,7 @@ def stream_reader(): |
448 | 447 | else: |
449 | 448 | self._logger.warning(f"Unexpected work item type: {request_type}") |
450 | 449 | except grpc.RpcError: |
451 | | - raise # let it be captured/parsed by outer except and avoid noisy log |
| 450 | + raise # let it be captured/parsed by outer except and avoid noisy log |
452 | 451 | except Exception as e: |
453 | 452 | self._logger.warning(f"Error in work item stream: {e}") |
454 | 453 | raise e |
@@ -1144,7 +1143,9 @@ def process_event(self, ctx: _RuntimeOrchestrationContext, event: pb.HistoryEven |
1144 | 1143 | if isinstance(activity_task, task.RetryableTask): |
1145 | 1144 | if activity_task._retry_policy is not None: |
1146 | 1145 | # Check for non-retryable errors by type name |
1147 | | - if task.is_error_non_retryable(event.taskFailed.failureDetails.errorType, activity_task._retry_policy): |
| 1146 | + if task.is_error_non_retryable( |
| 1147 | + event.taskFailed.failureDetails.errorType, activity_task._retry_policy |
| 1148 | + ): |
1148 | 1149 | activity_task.fail( |
1149 | 1150 | f"{ctx.instance_id}: Activity task #{task_id} failed: {event.taskFailed.failureDetails.errorMessage}", |
1150 | 1151 | event.taskFailed.failureDetails, |
@@ -1219,7 +1220,9 @@ def process_event(self, ctx: _RuntimeOrchestrationContext, event: pb.HistoryEven |
1219 | 1220 | if isinstance(sub_orch_task, task.RetryableTask): |
1220 | 1221 | if sub_orch_task._retry_policy is not None: |
1221 | 1222 | # Check for non-retryable errors by type name |
1222 | | - if task.is_error_non_retryable(failedEvent.failureDetails.errorType, sub_orch_task._retry_policy): |
| 1223 | + if task.is_error_non_retryable( |
| 1224 | + failedEvent.failureDetails.errorType, sub_orch_task._retry_policy |
| 1225 | + ): |
1223 | 1226 | sub_orch_task.fail( |
1224 | 1227 | f"Sub-orchestration task #{task_id} failed: {failedEvent.failureDetails.errorMessage}", |
1225 | 1228 | failedEvent.failureDetails, |
|
0 commit comments