Skip to content

Make Actors.Next runtime option defaults nullable and unset - #1903

Merged
WhitWaldo merged 2 commits into
dapr:masterfrom
JoshVanL:actors-next-nullable-defaults
Sep 1, 2026
Merged

WhitWaldo merged 2 commits into
dapr:masterfrom
JoshVanL:actors-next-nullable-defaults

Conversation

@JoshVanL

Copy link
Copy Markdown
Contributor

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

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>
@JoshVanL
JoshVanL requested a balanced review from Copilot August 27, 2026 15:57
@JoshVanL
JoshVanL requested review from a team as code owners August 27, 2026 15:57

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

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.

@WhitWaldo

Copy link
Copy Markdown
Contributor

@JoshVanL Does this PR take into account the per-actor options changes already in master (but not yet live)?

@JoshVanL

Copy link
Copy Markdown
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.

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