Skip to content

fix(pegboard): decode envoy actor eviction keys#4803

Open
NathanFlurry wants to merge 1 commit intoengine-stabilize/envoy-subscribe-before-registerfrom
engine-stabilize/envoy-evict-actor-keys
Open

fix(pegboard): decode envoy actor eviction keys#4803
NathanFlurry wants to merge 1 commit intoengine-stabilize/envoy-subscribe-before-registerfrom
engine-stabilize/envoy-evict-actor-keys

Conversation

@NathanFlurry
Copy link
Copy Markdown
Member

Description

Please include a summary of the changes and the related issue. Please also include relevant motivation and context.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Copy link
Copy Markdown
Member Author

NathanFlurry commented Apr 27, 2026

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@claude
Copy link
Copy Markdown

claude Bot commented Apr 27, 2026

Code Review

Overview

This is a one-line bug fix in engine/packages/pegboard/src/ops/envoy/evict_actors.rs. The function scans a UniversalDB subspace using keys::envoy::ActorKey::subspace(...) to find actor keys, but was then decoding each result with keys::runner::ActorKey — the wrong key type.

Analysis

The bug is real and impactful. The two key types have incompatible tuple layouts:

  • keys::runner::ActorKey unpacks as (usize, usize, Id, Id) — tuple (RUNNER, ACTOR, runner_id, actor_id)
  • keys::envoy::ActorKey unpacks as (usize, usize, usize, Id, String, Id) — tuple (NAMESPACE, ENVOY, ACTOR, namespace_id, envoy_key, actor_id)

Decoding an envoy actor key with the runner type would always fail deserialization (mismatched arity and component types), meaning pegboard_envoy_evict_actors would never successfully evict any actors. The fix is correct: decode with keys::envoy::ActorKey to match the subspace being queried.

The call site (ws_to_tunnel_task.rs:454) passes namespace_id and envoy_key, which matches the envoy subspace structure, confirming the fix is correct.

Suggestions

  • Tests: No tests cover this path. Since this was a silently broken eviction — actors would never be evicted when an envoy disconnects — it's worth adding at least an integration test verifying that pegboard_envoy_evict_actors actually sends GoingAway signals for the expected actors. This would have caught the bug immediately.
  • PR description: The checklist items are all unchecked, including "Bug fix". Marking the type and noting how this was caught/verified would help future reviewers.

Summary

The fix is correct and minimal. The main concern is the absence of test coverage for this path, which allowed the bug to silently regress.

@NathanFlurry NathanFlurry force-pushed the engine-stabilize/envoy-evict-actor-keys branch from a0065e2 to ba8ebbf Compare April 27, 2026 07:30
@NathanFlurry NathanFlurry marked this pull request as ready for review April 27, 2026 08:08
@NathanFlurry NathanFlurry force-pushed the engine-stabilize/envoy-subscribe-before-register branch from 090e234 to 7ca2768 Compare April 27, 2026 08:31
@NathanFlurry NathanFlurry force-pushed the engine-stabilize/envoy-evict-actor-keys branch from ba8ebbf to 4b89844 Compare April 27, 2026 08:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant