Make Actors.Next runtime option defaults nullable and unset - #1903
Merged
Merged
Conversation
The app-wide DaprActorsOptions forced SDK-side defaults for every runtime option and sent them unconditionally on the actor event stream, so the Dapr runtime defaults could never apply. Most notably DrainOngoingCallTimeout was hard-coded to 30 seconds, which sits exactly at the daprd drain clamp boundary (80% of the 30 second dissemination timeout) and above the placement service's 8 second dissemination deadline, causing configured-looking values the app never chose. Make ActorIdleTimeout, DrainOngoingCallTimeout (and its DrainRebalancedActorsTimeout alias), DrainRebalancedActors, EnableReentrancy, and MaxReentrantDepth nullable with no default. Null means unset: the field is omitted from the wire and the Dapr runtime default applies, matching the classic Dapr.Actors behaviour and the existing per-type DaprActorTypeOptions contract. This also drops the private setter on DrainOngoingCallTimeout, which previously made the alias the only way to set it. The transport now assigns only configured fields on ActorEntityConfig (all proto fields are optional with explicit presence), and emits the reentrancy config only when reentrancy options are set. The validator skips unset values using the same pattern as the per-type rules. SubscribeActorEventsInitialConfig is widened to nullable accordingly; Actors.Next is not packable so there is no shipped API surface break. Signed-off-by: joshvanl <me@joshvanl.dev>
Contributor
There was a problem hiding this comment.
Pull request overview
Makes Actors.Next runtime options nullable so unset values defer to Dapr runtime defaults.
Changes:
- Removes SDK-side defaults from actor runtime options.
- Serializes only explicitly configured fields.
- Updates validation and tests for nullable options.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
RealSidecarActorTests.cs |
Explicitly enables actor draining. |
GeneratedActorEventsTransportTests.cs |
Tests omitted wire fields. |
CoreRuntimeTests.cs |
Verifies unset configuration values. |
OptionsTests.cs |
Tests timeout alias nullability. |
SubscribeActorEventsResponse.cs |
Makes initial configuration nullable. |
DaprActorEventsTransport.cs |
Conditionally maps configured fields. |
DaprActorsOptionsValidator.cs |
Skips validation for unset values. |
DaprActorsOptions.cs |
Removes SDK defaults and exposes nullable options. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Contributor
|
@JoshVanL Does this PR take into account the per-actor options changes already in master (but not yet live)? |
Contributor
Author
|
@WhitWaldo Yep, this PR makes the app-wide side follow the same convention, so the resolution chain is now per-type -> app-wide -> daprd default, with unset fields omitted from the wire entirely. |
This was referenced Sep 27, 2026
This was referenced Oct 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The app-wide DaprActorsOptions forced SDK-side defaults for every runtime option and sent them unconditionally on the actor event stream, so the Dapr runtime defaults could never apply. Most notably DrainOngoingCallTimeout was hard-coded to 30 seconds, which sits exactly at the daprd drain clamp boundary (80% of the 30 second dissemination timeout) and above the placement service's 8 second dissemination deadline, causing configured-looking values the app never chose.
Make ActorIdleTimeout, DrainOngoingCallTimeout (and its DrainRebalancedActorsTimeout alias), DrainRebalancedActors, EnableReentrancy, and MaxReentrantDepth nullable with no default. Null means unset: the field is omitted from the wire and the Dapr runtime default applies, matching the classic Dapr.Actors behaviour and the existing per-type DaprActorTypeOptions contract. This also drops the private setter on DrainOngoingCallTimeout, which previously made the alias the only way to set it.
The transport now assigns only configured fields on ActorEntityConfig (all proto fields are optional with explicit presence), and emits the reentrancy config only when reentrancy options are set. The validator skips unset values using the same pattern as the per-type rules. SubscribeActorEventsInitialConfig is widened to nullable accordingly; Actors.Next is not packable so there is no shipped API surface break