Skip to content

default drain_ongoing_call_timeout to None#1016

Merged
sicoyle merged 3 commits intodapr:mainfrom
JoshVanL:default-drain-none
May 6, 2026
Merged

default drain_ongoing_call_timeout to None#1016
sicoyle merged 3 commits intodapr:mainfrom
JoshVanL:default-drain-none

Conversation

@JoshVanL
Copy link
Copy Markdown
Contributor

@JoshVanL JoshVanL commented May 6, 2026

ActorRuntimeConfig hardcoded drain_ongoing_call_timeout to 60s. The Dapr runtime's placement dissemination timeout defaults to 30s and drain blocks the placement LOCK -> UPDATE -> UNLOCK round, so a 60s drain stalls the disseminator and resets the placement stream.

Match the other SDKs (.NET, Go, Java, JS) by leaving the field unset, so daprd applies its 2s default (api.DefaultOngoingCallTimeout). Omit the field from as_dict() when None so a JSON null is not sent to the runtime.

ActorRuntimeConfig hardcoded drain_ongoing_call_timeout to 60s. The Dapr
runtime's placement dissemination timeout defaults to 30s and drain blocks
the placement LOCK -> UPDATE -> UNLOCK round, so a 60s drain stalls the
disseminator and resets the placement stream.

Match the other SDKs (.NET, Go, Java, JS) by leaving the field unset, so
daprd applies its 2s default (api.DefaultOngoingCallTimeout). Omit the
field from as_dict() when None so a JSON null is not sent to the runtime.

Signed-off-by: joshvanl <me@joshvanl.dev>
Copilot AI review requested due to automatic review settings May 6, 2026 13:31
@JoshVanL JoshVanL requested review from a team as code owners May 6, 2026 13:31
@codecov
Copy link
Copy Markdown

codecov Bot commented May 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.49%. Comparing base (bffb749) to head (544b6a3).
⚠️ Report is 121 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1016      +/-   ##
==========================================
- Coverage   86.63%   81.49%   -5.14%     
==========================================
  Files          84      138      +54     
  Lines        4473    13482    +9009     
==========================================
+ Hits         3875    10987    +7112     
- Misses        598     2495    +1897     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Contributor

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

This PR updates the Python SDK’s ActorRuntimeConfig defaults to avoid sending an explicit drainOngoingCallTimeout value to daprd, allowing the runtime to apply its own default instead of the SDK hardcoding 60s (which can interfere with placement dissemination timing).

Changes:

  • Default ActorRuntimeConfig.drain_ongoing_call_timeout to None instead of 60s.
  • Omit drainOngoingCallTimeout from ActorRuntimeConfig.as_dict() when the value is None (avoid sending JSON null).
  • Update and extend actor runtime config tests to reflect the new default and serialization behavior.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
dapr/actor/runtime/config.py Changes default drain_ongoing_call_timeout to None and conditionally serializes drainOngoingCallTimeout only when set.
tests/actor/test_actor.py Updates actor config default expectation to None.
tests/actor/test_actor_runtime.py Updates actor runtime config default expectation to None.
tests/actor/test_actor_runtime_config.py Updates default config tests and adds coverage asserting the key is omitted when unset and present when explicitly set.
Comments suppressed due to low confidence (1)

dapr/actor/runtime/config.py:125

  • actor_type_configs uses a mutable default ([]) in the ActorRuntimeConfig.__init__ signature. This list instance will be shared across ActorRuntimeConfig() calls, which can cause cross-instance state leakage if the list is ever mutated. Prefer actor_type_configs: Optional[List[ActorTypeConfig]] = None and assign actor_type_configs or [] inside the constructor.
        drain_ongoing_call_timeout: Optional[timedelta] = None,
        drain_rebalanced_actors: Optional[bool] = True,
        reentrancy: Optional[ActorReentrancyConfig] = None,
        reminders_storage_partitions: Optional[int] = None,
        actor_type_configs: List[ActorTypeConfig] = [],
    ):

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

Comment thread dapr/actor/runtime/config.py
Signed-off-by: joshvanl <me@joshvanl.dev>
Copy link
Copy Markdown
Contributor

@sicoyle sicoyle left a comment

Choose a reason for hiding this comment

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

thank you!!

@sicoyle sicoyle added this pull request to the merge queue May 6, 2026
Merged via the queue into dapr:main with commit 77e3bcf May 6, 2026
16 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants