File tree Expand file tree Collapse file tree
durabletask-azuremanaged/durabletask/azuremanaged/preview/sandboxes
tests/durabletask-azuremanaged Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -249,35 +249,20 @@ def _resolve_dts_sandbox_identifier() -> str:
249249 grpc .StatusCode .UNKNOWN ,
250250}
251251
252- _PERMANENT_FAILED_PRECONDITION_DETAILS = (
253- "worker profile" ,
254- "registered activit" ,
255- "max activit" ,
256- "sandbox identifier" ,
257- "sandbox id" ,
258- )
252+ # TODO: Selectively retry FAILED_PRECONDITION only after sandbox worker
253+ # registration exposes structured, machine-readable transient reasons.
259254
260255
261256def _is_retriable_registration_failure (ex : Exception ) -> bool :
262257 if isinstance (ex , grpc .RpcError ):
263258 status_code = ex .code ()
264259 if status_code in _RETRIABLE_REGISTRATION_STATUS_CODES :
265260 return True
266- if status_code == grpc .StatusCode .FAILED_PRECONDITION :
267- details = _rpc_error_details (ex ).casefold ()
268- return not any (
269- detail in details
270- for detail in _PERMANENT_FAILED_PRECONDITION_DETAILS )
271261 return False
272262
273263 return isinstance (ex , OSError )
274264
275265
276- def _rpc_error_details (ex : grpc .RpcError ) -> str :
277- details = ex .details ()
278- return details if isinstance (details , str ) else ""
279-
280-
281266def _resolve_max_concurrent_activities () -> int :
282267 value = os .getenv ("DTS_SANDBOX_MAX_ACTIVITIES" )
283268 if value is None :
Original file line number Diff line number Diff line change @@ -755,10 +755,10 @@ def RemoteHello(_ctx, value):
755755 assert start .start .sandbox_provider == pb .SANDBOX_PROVIDER_KIND_UNSPECIFIED
756756
757757
758- def test_sandbox_registration_retries_transient_failures_only () -> None :
758+ def test_sandbox_registration_does_not_retry_failed_precondition_without_structured_reasons () -> None :
759759 assert sandbox_worker ._is_retriable_registration_failure (
760760 _FakeRpcError (grpc .StatusCode .UNAVAILABLE ))
761- assert sandbox_worker ._is_retriable_registration_failure (
761+ assert not sandbox_worker ._is_retriable_registration_failure (
762762 _FakeRpcError (grpc .StatusCode .FAILED_PRECONDITION , "sandbox not ready" ))
763763 assert not sandbox_worker ._is_retriable_registration_failure (
764764 _FakeRpcError (grpc .StatusCode .INVALID_ARGUMENT ))
You can’t perform that action at this time.
0 commit comments