-
Notifications
You must be signed in to change notification settings - Fork 139
chore: fix runner config creation #3580
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
3 Skipped Deployments
|
How to use the Graphite Merge QueueAdd the label merge-queue to this PR to add it to the merge queue. You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
Code Review - PR #3580: Fix runner config creationOverviewThis PR addresses a race condition where runner pool workflows might not exist when signaling them during runner config operations. The fix adds graceful handling and backfill logic to ensure workflows are created when needed. ✅ Strengths
🔍 Observations & Suggestions1. Asymmetric Handling Between Delete and UpsertIn Current behavior in delete.rs:56-58: if res.is_none() {
tracing::debug!(namespace_id=?input.namespace_id, name=%input.name, "no runner pool workflow to bump");
}Question: Should delete also attempt to clean up or create a workflow? Or is the current behavior correct because deleting a config when no pool exists is a no-op? If the latter, consider adding a comment explaining why delete differs from upsert. 2. Race Condition in Backfill LogicIn // Backfill
if res.is_none() {
ctx.workflow(crate::workflows::runner_pool::Input {
namespace_id: input.namespace_id,
runner_name: input.name.clone(),
})
.tag("namespace_id", input.namespace_id)
.tag("runner_name", input.name.clone())
.unique() // ✅ Good: prevents duplicates
.dispatch()
.await?;
}The 3. Logging ConsistencyThe debug message in
Consider if upsert should also log when it performs a backfill for consistency: if res.is_none() {
tracing::debug!(namespace_id=?input.namespace_id, name=%input.name, "backfilling runner pool workflow");
ctx.workflow(/* ... */).dispatch().await?;
}4. Potential Enhancement: MetricsConsider adding metrics for these scenarios:
This would help monitor how often these edge cases occur in production. 🔒 Security & Performance
📋 Testing ConsiderationsWhile the code looks correct, consider testing these scenarios:
Minor Style NotesPer CLAUDE.md guidelines, everything looks good:
Verdict✅ Approve with minor suggestions The core fix is solid and addresses the race condition properly. The main question is whether the asymmetric handling between delete and upsert is intentional. If so, adding a comment explaining the design decision would be helpful for future maintainers. The changes are:
Recommended before merge:
|
More templates
@rivetkit/cloudflare-workers
@rivetkit/db
@rivetkit/framework-base
@rivetkit/next-js
@rivetkit/react
rivetkit
@rivetkit/sql-loader
@rivetkit/engine-runner
@rivetkit/engine-runner-protocol
commit: |
5339a83 to
a7e1a7c
Compare
a7e1a7c to
5883242
Compare
5883242 to
fa8ced8
Compare
fa8ced8 to
e5eb5e5
Compare
e5eb5e5 to
fa8ced8
Compare
Merge activity
|

No description provided.