Skip to content

Commit fbce56e

Browse files
authored
Merge pull request dapr#8635 from JoshVanL/actors-reminders-always-set
Prevent panic of reminder operations on slow Actor Startup
2 parents e7a8637 + 7359393 commit fbce56e

File tree

2 files changed

+29
-8
lines changed

2 files changed

+29
-8
lines changed

docs/release_notes/v1.15.4.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ This update includes bug fixes:
44

55
- [Fix degradation of Workflow runtime performance over time](#fix-degradation-of-workflow-runtime-performance-over-time)
66
- [Allow Service Account for MetalBear mirrord operator in sidecar injector](#allow-service-account-for-metalbear-mirrord-operator-in-sidecar-injector)
7+
- [Prevent panic of reminder operations on slow Actor Startup](#prevent-panic-of-reminder-operations-on-slow-actor-startup)
78

89
## Fix degradation of Workflow runtime performance over time
910

@@ -41,4 +42,22 @@ Mirrord Operator is not on the allow list of Service Accounts for the dapr sidec
4142

4243
### Solution
4344

44-
Add the Mirrord Operator into the allow list of Service Accounts for the dapr sidecar injector.
45+
Add the Mirrord Operator into the allow list of Service Accounts for the dapr sidecar injector.
46+
47+
## Prevent panic of reminder operations on slow Actor Startup
48+
49+
### Problem
50+
51+
The Dapr runtime HTTP server would panic if a reminder operation timed out while an Actor was starting up.
52+
53+
### Impact
54+
55+
The HTTP server would panic, causing degraded performance.
56+
57+
### Root cause
58+
59+
The Dapr runtime would attempt to use the reminder service before it was initialized.
60+
61+
### Solution
62+
63+
Correctly return an errors that the actor runtime was not ready in time for the reminder operation.

pkg/actors/actors.go

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -193,12 +193,10 @@ func (a *actors) Init(opts InitOptions) error {
193193

194194
storeEnabled := a.buildStateStore(opts, apiLevel)
195195

196-
if a.reminderStore != nil {
197-
a.reminders = reminders.New(reminders.Options{
198-
Storage: a.reminderStore,
199-
Table: a.table,
200-
})
201-
}
196+
a.reminders = reminders.New(reminders.Options{
197+
Storage: a.reminderStore,
198+
Table: a.table,
199+
})
202200

203201
var err error
204202
a.placement, err = placement.New(placement.Options{
@@ -357,6 +355,10 @@ func (a *actors) Reminders(ctx context.Context) (reminders.Interface, error) {
357355
return nil, err
358356
}
359357

358+
if a.reminders == nil {
359+
return nil, messages.ErrActorRuntimeNotFound
360+
}
361+
360362
return a.reminders, nil
361363
}
362364

@@ -374,7 +376,7 @@ func (a *actors) waitForReady(ctx context.Context) error {
374376
}
375377
return nil
376378
case <-ctx.Done():
377-
return ctx.Err()
379+
return messages.ErrActorRuntimeNotFound
378380
}
379381
}
380382

0 commit comments

Comments
 (0)