Skip to content

Commit 36392d2

Browse files
committed
fix(pegboard): refresh runner config after envoy connect
1 parent 1a47f5e commit 36392d2

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

engine/packages/pegboard-envoy/src/conn.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,12 @@ pub async fn init_conn(
279279
.custom_instrument(tracing::info_span!("envoy_init_tx")),
280280
)?;
281281

282+
// Serverful pools update protocol version directly from the envoy
283+
// connection path. Purge the runner-config caches so the first actor
284+
// request after connect does not keep seeing a stale pre-mk2 config.
285+
pegboard::utils::purge_runner_config_caches(ctx.cache(), namespace.namespace_id, &pool_name)
286+
.await?;
287+
282288
// Send missed commands (must be after init packet)
283289
if !missed_commands.is_empty() {
284290
let msg = {

engine/packages/pegboard/src/ops/actor/create.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,11 @@ pub async fn pegboard_actor_create(ctx: &OperationCtx, input: &Input) -> Result<
4747
ctx.subscribe::<crate::workflows::actor2::DestroyStarted>(("actor_id", input.actor_id)),
4848
ctx.op(crate::ops::runner_config::get::Input {
4949
runners: vec![(input.namespace_id, input.runner_name_selector.clone())],
50-
bypass_cache: false,
50+
// Protocol version decides whether we dispatch the mk1 or mk2 actor
51+
// workflow. A freshly connected envoy can update this immediately
52+
// before the first actor request, so this read must not use a stale
53+
// cached runner config.
54+
bypass_cache: true,
5155
}),
5256
)?;
5357

0 commit comments

Comments
 (0)