Skip to content

fix: move runner configs to epoxy#4605

Draft
MasterPtato wants to merge 1 commit into04-09-fix_epoxy_add_list_operationfrom
04-10-fix_move_runner_configs_to_epoxy
Draft

fix: move runner configs to epoxy#4605
MasterPtato wants to merge 1 commit into04-09-fix_epoxy_add_list_operationfrom
04-10-fix_move_runner_configs_to_epoxy

Conversation

@MasterPtato
Copy link
Copy Markdown
Contributor

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
Contributor Author

@claude
Copy link
Copy Markdown

claude bot commented Apr 11, 2026

PR Review: fix: move runner configs to epoxy

Note: This is a draft PR in a stack. The review focuses on the changes introduced in this diff.

Critical Issues (Blockers)

1. todo!() macros in production code paths

engine/packages/pegboard/src/ops/runner_config/upsert.rs, lines ~87, 145-146:

Three todo!() macros sit in active code paths. Every call to pegboard_runner_config_upsert will panic at runtime. The first is a missing runners argument in the get::Input struct; the other two are incomplete secondary-index updates for ByVariantKey ("clear previous by variant key" and "write by variant key").

2. ByVariantKey secondary index never updated

Because the todo!()s above are never executed, the secondary index used by list.rs for variant-filtered listings will always see stale/missing data after an upsert. delete.rs still writes this index via UDB, creating an asymmetry that will cause correctness issues.

3. ServerlessDesiredSlotsKey initialization removed without replacement

The old upsert transaction initialized ServerlessDesiredSlotsKey to 0 via MutationType::Add when a new serverless config was created. This initialization is gone from the new code. runner_pool.rs does unwrap_or_default() on the read so it will not crash, but metrics aggregation skips entries where desired_slots == 0, and pool behavior may differ before any actor writes the key.

Significant Issues

4. Redundant .clone() on config_packed

In upsert.rs: value: Some(config_packed.clone())config_packed is not used after this point so .clone() is unnecessary.

5. Instrumentation span removed

The old upsert had .custom_instrument(tracing::info_span!("runner_config_upsert_tx")) on the UDB transaction. This span is gone in the new code, reducing observability. The epoxy propose call should be instrumented instead.

6. format!() for string literals without interpolation

In upsert.rs, reason: format!("invalid header name: too long (max 128)") and reason: format!("invalid header value: too long (max 4096)") contain no interpolation — use .to_string() or a string slice directly.

Minor Issues

7. Trailing double-backtick in doc comments

Both get.rs and list.rs contain a doc comment with an extra trailing backtick at the end of the `envoyProtocolVersion` reference.

8. buffer_unordered(512) is unnecessarily high in list.rs

ProtocolVersionKey reads are fanned out with buffer_unordered(512), but the page limit is 100. Reducing to ~64 avoids accidental over-concurrency if the limit is raised later.

9. Code duplication between variant/non-variant branches in list.rs

Both branches perform identical ProtocolVersionKey lookups and RunnerConfig struct construction. Only the KV key type differs — the shared logic should be extracted.

Positive Observations

  • Moving validation before the DB transaction is a strict improvement: errors fail fast without holding a transaction open.
  • Removing list_optimistic.rs (~184 lines of dead code) is a clean simplification.
  • get_epoxy_kv_local simplification in internal.rs is correct.
  • protocol_version propagation through get/list/response layers is clean and consistent.
  • The responses.into_iter().flatten().next() change in get_optimistic.rs is semantically correct given the new closure return type.

Summary

This PR is not ready to merge due to the three todo!() panics (issues 1–2) and the missing ServerlessDesiredSlotsKey initialization (issue 3). The refactor direction is correct once those are resolved.

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