Skip to content

Add Actor State TTL support - #1919

Closed
adityav1709 wants to merge 4 commits into
dapr:masterfrom
adityav1709:actor-state-ttl-1338
Closed

adityav1709 wants to merge 4 commits into
dapr:masterfrom
adityav1709:actor-state-ttl-1338

Conversation

@adityav1709

@adityav1709 adityav1709 commented Nov 22, 2026 •

Copy link
Copy Markdown

Fixes #849.

This builds on #1338, rebased onto current master.

What it does

  • Adds an overload to save actor state with a TTL, while add(String, T) and set(String, T) stay as they are. No @deprecated on set while the feature is in preview.
  • DaprClientImpl sends ttlInSeconds on save and reads ttlExpireTime on read, so the ActorStateManager cache knows when a key expires.
  • Removes unused imports in DaprStateAsyncProvider.
  • Preview feature flags are now supported in the testcontainers Configuration, so the test can enable ActorStateTTL.

Tests

  • New TTL integration test on MySQL with the ActorStateTTL preview flag enabled. Other actor tests stay on Redis, because Redis does not return ttlExpireTime.
  • Unit tests cover ttlInSeconds and ttlExpireTime handling in DaprClientImpl.

Caveat: the cache only knows a key expired when the store returns ttlExpireTime. Redis does not, so the MySQL test is the one that proves the expiry path.

@adityav1709
adityav1709 requested review from a team as code owners November 22, 2026 17:07
@adityav1709

Copy link
Copy Markdown
Author

Closing in favor of #1920, the replacement PR with DCO sign-offs.

@adityav1709
adityav1709 deleted the actor-state-ttl-1338 branch November 23, 2026 08:55
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.

FEATURE PREVIEW: Add Actor State TTL support

1 participant