feat(container-runner): sleep on startup idle timeout - #5586
Conversation
|
Stack for rivet-dev/actors
Get stack: change ontuyypk |
Code ReviewReviewed Bugs1. async fn on_sleep(self: Arc<Self>, ctx: Ctx<Self>) -> Result<()> {
if idle_timeout().is_some() {
self.stop_child(ctx.actor_id(), "actor sleeping (idle)").await;
} else {
self.drain_then_stop_child(ctx.actor_id(), "actor sleeping").await;
}
Ok(())
}The branch is keyed on whether The existing 2. The duplicate-start early-return path never arms the idle timer for the new if let Some(existing) = children().read_async(&actor_id, |_, c| c.clone()).await {
if !existing.has_exited() {
...
register_ctx(&actor_id, &ctx).await;
*self.child.lock().await = Some(existing);
return Ok(());
}
}Compare with the normal-start path, which calls Minor / style3. const IDLE_ARMED: u8 = 0;
const IDLE_REQUESTED: u8 = 1;
...
idle_state: AtomicU8,The field is only ever compared for equality with Other notes
No security concerns; this is a container-runner-local lifecycle feature and doesn't cross the client/engine or envoy/pegboard-envoy trust boundaries. |
aee8b0b to
ef4d957
Compare
102498a to
2e9fde1
Compare
ef4d957 to
d82ea5e
Compare
2e9fde1 to
5b11c04
Compare
5b11c04 to
985b564
Compare
d82ea5e to
1c95b91
Compare
No description provided.