Skip to content

default drain_ongoing_call_timeout to None#1016

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

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

Conversation

@JoshVanL

@JoshVanL JoshVanL commented May 6, 2026

Copy link
Copy Markdown
Contributor

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

codecov Bot commented May 6, 2026

Copy link
Copy Markdown

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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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>

@sicoyle sicoyle left a comment

Copy link
Copy Markdown
Contributor

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
sicoyle added a commit that referenced this pull request May 19, 2026
* default drain_ongoing_call_timeout to None

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.



* Update comment



---------


(cherry picked from commit 77e3bcf)

Signed-off-by: joshvanl <me@joshvanl.dev>
Signed-off-by: dapr-bot <dapr-bot@users.noreply.github.com>
Co-authored-by: Josh van Leeuwen <me@joshvanl.dev>
Co-authored-by: Sam <sam@diagrid.io>
sicoyle added a commit that referenced this pull request May 19, 2026
* default drain_ongoing_call_timeout to None

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.



* Update comment



---------


(cherry picked from commit 77e3bcf)

Signed-off-by: joshvanl <me@joshvanl.dev>
Signed-off-by: dapr-bot <dapr-bot@users.noreply.github.com>
Co-authored-by: Josh van Leeuwen <me@joshvanl.dev>
Co-authored-by: Sam <sam@diagrid.io>
@nelson-parente nelson-parente added this to the v1.18 milestone May 20, 2026
@marcduiker

Copy link
Copy Markdown
Contributor

@holopin-bot @JoshVanL sdk-badge Thank you! Here's a digital badge as a small token of appreciation.

@holopin-bot

holopin-bot Bot commented Jun 12, 2026

Copy link
Copy Markdown

Congratulations @JoshVanL, the maintainer of this repository has issued you a badge! Here it is: https://holopin.io/claim/cmqbf8j95000bje0a47ptyn97

This badge can only be claimed by you, so make sure that your GitHub account is linked to your Holopin account. You can manage those preferences here: https://holopin.io/account.
Or if you're new to Holopin, you can simply sign up with GitHub, which will do the trick!

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.

7 participants