Skip to content

Commit 3444072

Browse files
committed
fix(pegboard): restore hibernating requests on serverful start
1 parent 6aed029 commit 3444072

1 file changed

Lines changed: 12 additions & 3 deletions

File tree

  • engine/packages/pegboard/src/workflows/actor2

engine/packages/pegboard/src/workflows/actor2/runtime.rs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,17 @@ pub async fn send_outbound(ctx: &ActivityCtx, input: &SendOutboundInput) -> Resu
358358
.await?;
359359
}
360360
Allocation::Serverful { envoy_key } => {
361+
let hibernating_requests = ctx
362+
.op(crate::ops::actor::hibernating_request::list::Input {
363+
actor_id: state.actor_id,
364+
})
365+
.await?
366+
.into_iter()
367+
.map(|request| protocol::HibernatingRequest {
368+
gateway_id: request.gateway_id,
369+
request_id: request.request_id,
370+
})
371+
.collect();
361372
let command = protocol::Command::CommandStartActor(protocol::CommandStartActor {
362373
config: protocol::ActorConfig {
363374
name: state.name.clone(),
@@ -368,9 +379,7 @@ pub async fn send_outbound(ctx: &ActivityCtx, input: &SendOutboundInput) -> Resu
368379
.as_ref()
369380
.and_then(|x| BASE64_STANDARD.decode(x).ok()),
370381
},
371-
// Empty because request ids are ephemeral. This is intercepted by guard and
372-
// populated before it reaches the runner
373-
hibernating_requests: Vec::new(),
382+
hibernating_requests,
374383
preloaded_kv: None,
375384
});
376385

0 commit comments

Comments
 (0)