From 733af7930c821e145d94aa9f70e28e38990536b0 Mon Sep 17 00:00:00 2001 From: Fabian Martinez <46371672+famarting@users.noreply.github.com> Date: Thu, 12 Mar 2026 19:39:30 +0100 Subject: [PATCH 1/3] fix: apply DAPR_API_TIMEOUT_SECONDS to workflow gRPC connections The workflow extension's gRPC connections (DaprWorkflowClient, async DaprWorkflowClient, and WorkflowRuntime) were not respecting the DAPR_API_TIMEOUT_SECONDS environment variable, unlike the core SDK's DaprGrpcClient which applies it via a timeout interceptor. Pass DaprClientTimeoutInterceptor (sync) and DaprClientTimeoutInterceptorAsync (async) to the durabletask TaskHubGrpcClient, AsyncTaskHubGrpcClient, and TaskHubGrpcWorker so that workflow gRPC calls get the configured default timeout. Signed-off-by: Fabian Martinez Signed-off-by: Fabian Martinez <46371672+famarting@users.noreply.github.com> --- .../dapr/ext/workflow/aio/dapr_workflow_client.py | 2 ++ .../dapr/ext/workflow/dapr_workflow_client.py | 2 ++ ext/dapr-ext-workflow/dapr/ext/workflow/workflow_runtime.py | 6 +++++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ext/dapr-ext-workflow/dapr/ext/workflow/aio/dapr_workflow_client.py b/ext/dapr-ext-workflow/dapr/ext/workflow/aio/dapr_workflow_client.py index cd5e632f..bf44f5c8 100644 --- a/ext/dapr-ext-workflow/dapr/ext/workflow/aio/dapr_workflow_client.py +++ b/ext/dapr-ext-workflow/dapr/ext/workflow/aio/dapr_workflow_client.py @@ -27,6 +27,7 @@ from grpc.aio import AioRpcError from dapr.clients import DaprInternalError +from dapr.aio.clients.grpc.interceptors import DaprClientTimeoutInterceptorAsync from dapr.clients.http.client import DAPR_API_TOKEN_HEADER from dapr.conf import settings from dapr.conf.helpers import GrpcEndpoint @@ -68,6 +69,7 @@ def __init__( secure_channel=uri.tls, log_handler=options.log_handler, log_formatter=options.log_formatter, + interceptors=[DaprClientTimeoutInterceptorAsync()], ) async def schedule_new_workflow( diff --git a/ext/dapr-ext-workflow/dapr/ext/workflow/dapr_workflow_client.py b/ext/dapr-ext-workflow/dapr/ext/workflow/dapr_workflow_client.py index 36a731c4..1aa85472 100644 --- a/ext/dapr-ext-workflow/dapr/ext/workflow/dapr_workflow_client.py +++ b/ext/dapr-ext-workflow/dapr/ext/workflow/dapr_workflow_client.py @@ -27,6 +27,7 @@ from grpc import RpcError from dapr.clients import DaprInternalError +from dapr.clients.grpc.interceptors import DaprClientTimeoutInterceptor from dapr.clients.http.client import DAPR_API_TOKEN_HEADER from dapr.conf import settings from dapr.conf.helpers import GrpcEndpoint @@ -71,6 +72,7 @@ def __init__( secure_channel=uri.tls, log_handler=options.log_handler, log_formatter=options.log_formatter, + interceptors=[DaprClientTimeoutInterceptor()], ) def schedule_new_workflow( diff --git a/ext/dapr-ext-workflow/dapr/ext/workflow/workflow_runtime.py b/ext/dapr-ext-workflow/dapr/ext/workflow/workflow_runtime.py index e2bf50d4..53ddfc0e 100644 --- a/ext/dapr-ext-workflow/dapr/ext/workflow/workflow_runtime.py +++ b/ext/dapr-ext-workflow/dapr/ext/workflow/workflow_runtime.py @@ -27,6 +27,7 @@ from durabletask import task, worker from dapr.clients import DaprInternalError +from dapr.clients.grpc.interceptors import DaprClientTimeoutInterceptor from dapr.clients.http.client import DAPR_API_TOKEN_HEADER from dapr.conf import settings from dapr.conf.helpers import GrpcEndpoint @@ -71,13 +72,16 @@ def __init__( raise DaprInternalError(f'{error}') from error options = self._logger.get_options() + all_interceptors = [DaprClientTimeoutInterceptor()] + if interceptors: + all_interceptors.extend(interceptors) self.__worker = worker.TaskHubGrpcWorker( host_address=uri.endpoint, metadata=metadata, secure_channel=uri.tls, log_handler=options.log_handler, log_formatter=options.log_formatter, - interceptors=interceptors, + interceptors=all_interceptors, concurrency_options=worker.ConcurrencyOptions( maximum_concurrent_activity_work_items=maximum_concurrent_activity_work_items, maximum_concurrent_orchestration_work_items=maximum_concurrent_orchestration_work_items, From b0395b30262a67fedec8ae883e0c4553977374e3 Mon Sep 17 00:00:00 2001 From: Fabian Martinez <46371672+famarting@users.noreply.github.com> Date: Fri, 13 Mar 2026 08:53:12 +0100 Subject: [PATCH 2/3] lint Signed-off-by: Fabian Martinez <46371672+famarting@users.noreply.github.com> --- .../dapr/ext/workflow/aio/dapr_workflow_client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/dapr-ext-workflow/dapr/ext/workflow/aio/dapr_workflow_client.py b/ext/dapr-ext-workflow/dapr/ext/workflow/aio/dapr_workflow_client.py index bf44f5c8..339b6b77 100644 --- a/ext/dapr-ext-workflow/dapr/ext/workflow/aio/dapr_workflow_client.py +++ b/ext/dapr-ext-workflow/dapr/ext/workflow/aio/dapr_workflow_client.py @@ -26,8 +26,8 @@ from durabletask.aio import client as aioclient from grpc.aio import AioRpcError -from dapr.clients import DaprInternalError from dapr.aio.clients.grpc.interceptors import DaprClientTimeoutInterceptorAsync +from dapr.clients import DaprInternalError from dapr.clients.http.client import DAPR_API_TOKEN_HEADER from dapr.conf import settings from dapr.conf.helpers import GrpcEndpoint From 7034b313ee860b1bc4502ac66a2ea0120363a1c3 Mon Sep 17 00:00:00 2001 From: Fabian Martinez <46371672+famarting@users.noreply.github.com> Date: Fri, 13 Mar 2026 13:36:48 +0100 Subject: [PATCH 3/3] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Fabian Martinez <46371672+famarting@users.noreply.github.com> --- ext/dapr-ext-workflow/dapr/ext/workflow/workflow_runtime.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ext/dapr-ext-workflow/dapr/ext/workflow/workflow_runtime.py b/ext/dapr-ext-workflow/dapr/ext/workflow/workflow_runtime.py index 53ddfc0e..4c47c566 100644 --- a/ext/dapr-ext-workflow/dapr/ext/workflow/workflow_runtime.py +++ b/ext/dapr-ext-workflow/dapr/ext/workflow/workflow_runtime.py @@ -72,9 +72,10 @@ def __init__( raise DaprInternalError(f'{error}') from error options = self._logger.get_options() - all_interceptors = [DaprClientTimeoutInterceptor()] + all_interceptors = [] if interceptors: all_interceptors.extend(interceptors) + all_interceptors.append(DaprClientTimeoutInterceptor()) self.__worker = worker.TaskHubGrpcWorker( host_address=uri.endpoint, metadata=metadata,