Skip to content

No 60s timeout by default#956

Open
cicoyle wants to merge 2 commits intodapr:mainfrom
cicoyle:fix-tools-not-respecting-resiliency
Open

No 60s timeout by default#956
cicoyle wants to merge 2 commits intodapr:mainfrom
cicoyle:fix-tools-not-respecting-resiliency

Conversation

@cicoyle
Copy link
Contributor

@cicoyle cicoyle commented Mar 12, 2026

Remove hardcoded 60s default timeout. Only apply if explicitly configured.

I was running a long running agent/wf and it was being killed by this and it was not respecting the resiliency configured. An SDK-level default deadline that fires before resiliency can act prevents retries from ever being attempted...

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>
Copilot AI review requested due to automatic review settings March 12, 2026 22:32
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Removes the SDK’s implicit 60s gRPC deadline so long-running operations (e.g., workflows/LLM calls) aren’t cut off before Dapr resiliency policies and component timeouts can apply.

Changes:

  • Set DAPR_API_TIMEOUT_SECONDS default to None (no deadline unless explicitly configured).
  • Update sync and async gRPC timeout interceptors to only apply a deadline when DAPR_API_TIMEOUT_SECONDS is configured, and to pass it as a float.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
dapr/conf/global_settings.py Removes the hardcoded default gRPC timeout by setting DAPR_API_TIMEOUT_SECONDS to None.
dapr/clients/grpc/interceptors.py Applies a global gRPC timeout only when explicitly configured via settings.
dapr/aio/clients/grpc/interceptors.py Mirrors the explicit-only timeout behavior for the asyncio gRPC client.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment on lines +30 to 35
# Only apply a deadline when DAPR_API_TIMEOUT_SECONDS is explicitly configured.
# Without an explicit setting there is no SDK-level default deadline: Dapr's own
# resiliency policies and component timeouts act as the authoritative bounds for
# long-running operations such as LLM calls and workflow activities.
if settings.DAPR_API_TIMEOUT_SECONDS is not None and client_call_details.timeout is None:
new_client_call_details = _ClientCallDetails(
Copy link

Copilot AI Mar 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New behavior adds a branch where client_call_details.timeout is None but settings.DAPR_API_TIMEOUT_SECONDS is also None, so no timeout should be applied. Existing tests cover the configured-timeout and per-call-timeout cases, but there’s no test ensuring the interceptor leaves the call details unchanged when the global setting is unset; please add coverage for this to prevent regressions back to an implicit default deadline.

Copilot uses AI. Check for mistakes.
Comment on lines +44 to 49
# Only apply a deadline when DAPR_API_TIMEOUT_SECONDS is explicitly configured.
# Without an explicit setting there is no SDK-level default deadline: Dapr's own
# resiliency policies and component timeouts act as the authoritative bounds for
# long-running operations such as LLM calls and workflow activities.
if settings.DAPR_API_TIMEOUT_SECONDS is not None and client_call_details.timeout is None:
new_client_call_details = _ClientCallDetailsAsync(
Copy link

Copilot AI Mar 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New behavior adds a branch where client_call_details.timeout is None but settings.DAPR_API_TIMEOUT_SECONDS is also None, so no timeout should be applied. Existing tests cover the configured-timeout and per-call-timeout cases, but there’s no test ensuring the interceptor leaves the call details unchanged when the global setting is unset; please add coverage for this to prevent regressions back to an implicit default deadline.

Copilot uses AI. Check for mistakes.
@sicoyle sicoyle requested review from a team as code owners March 13, 2026 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants