You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Please include a summary of the changes and the related issue. Please also include relevant motivation and context.
Type of change
How Has This Been Tested?
Please describe the tests that you ran to verify your changes.
Checklist: