Skip to content

Commit 3b027cc

Browse files
committed
fix(pegboard): fix actors getting destroyed on runner shutdown
1 parent 986289f commit 3b027cc

File tree

1 file changed

+8
-4
lines changed
  • engine/packages/pegboard/src/workflows/actor

1 file changed

+8
-4
lines changed

engine/packages/pegboard/src/workflows/actor/mod.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -666,8 +666,8 @@ async fn handle_stopped(
666666
}
667667
);
668668

669-
match (input.crash_policy, failed) {
670-
(CrashPolicy::Restart, true) => {
669+
match input.crash_policy {
670+
CrashPolicy::Restart => {
671671
match runtime::reschedule_actor(ctx, &input, state, false).await? {
672672
runtime::SpawnActorOutput::Allocated { .. } => {}
673673
// NOTE: Its not possible for `SpawnActorOutput::Sleep` to be returned here, the crash
@@ -678,8 +678,12 @@ async fn handle_stopped(
678678
}
679679
}
680680
}
681-
(CrashPolicy::Sleep, true) => {
682-
tracing::debug!(actor_id=?input.actor_id, "actor sleeping due to crash");
681+
CrashPolicy::Sleep => {
682+
if failed {
683+
tracing::debug!(actor_id=?input.actor_id, "actor sleeping due to crash");
684+
} else {
685+
tracing::debug!(actor_id=?input.actor_id, "actor sleeping due to clean shutdown");
686+
}
683687

684688
state.sleeping = true;
685689

0 commit comments

Comments
 (0)