Skip to content

fix(pb): clear actor reschedule ts on alloc#4338

Open
MasterPtato wants to merge 1 commit intofix-api-properly-dedup-name-listfrom
fix-pb-clear-actor-reschedule-ts
Open

fix(pb): clear actor reschedule ts on alloc#4338
MasterPtato wants to merge 1 commit intofix-api-properly-dedup-name-listfrom
fix-pb-clear-actor-reschedule-ts

Conversation

@MasterPtato
Copy link
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

@MasterPtato MasterPtato requested a review from NathanFlurry March 3, 2026 00:11
@railway-app
Copy link

railway-app bot commented Mar 3, 2026

🚅 Deployed to the rivet-pr-4338 environment in rivet-frontend

Service Status Web Updated (UTC)
frontend-cloud 😴 Sleeping (View Logs) Web Mar 3, 2026 at 12:22 am
website 😴 Sleeping (View Logs) Web Mar 3, 2026 at 12:22 am
frontend-inspector 😴 Sleeping (View Logs) Web Mar 3, 2026 at 12:21 am
mcp-hub ✅ Success (View Logs) Web Mar 3, 2026 at 12:13 am
ladle ❌ Build Failed (View Logs) Web Mar 3, 2026 at 12:12 am

@claude
Copy link

claude bot commented Mar 3, 2026

PR Review: fix(pb): clear actor reschedule ts on alloc

Summary: This is a minimal, focused bug fix: one line added in the actual logic, plus a Cargo.lock cleanup.


The Fix (engine/packages/pegboard/src/workflows/actor/runtime.rs:481)

Correctness: This is the right fix. Without it, reschedule_ts would persist in the actor State after a successful allocation even though the actor is no longer waiting to be rescheduled. The reschedule_ts field is surfaced externally via ops/actor/util.rs (line 75), so a stale non-None value would give callers a misleading view of actor state.

The pattern matches how other timestamps are handled: sleep_ts, pending_allocation_ts, and failure_reason are all cleared in the AllocateActorStatus::Allocated arm of the match below (lines 489-493). Clearing reschedule_ts before branching into the match is appropriate since it should be None regardless of whether allocation succeeded, is pending, or put the actor to sleep — the reschedule delay has been consumed once allocation is attempted.

One minor observation: state.sleep_ts, state.pending_allocation_ts, and state.failure_reason are only cleared in the Allocated arm, not for Pending or Sleep. The new reschedule_ts = None is unconditional (applies to all three match arms). This is likely intentional — the reschedule window has passed once allocate_actor_v2 is called — but worth confirming that Pending and Sleep paths do not need reschedule_ts preserved for any downstream logic.


Cargo.lock change

Removal of the indexmap 2.10.0 dependency is a straightforward cleanup from removing an unused transitive dep. No concerns here.


Overall

The fix is correct, minimal, and consistent with surrounding code patterns. No test coverage is included (the PR checklist is unchecked), which is understandable given that reproducing this requires a specific multi-step actor lifecycle scenario. If there is an existing integration test for actor rescheduling, it would be worth adding an assertion that reschedule_ts is null after re-allocation.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Mar 3, 2026

More templates

@rivetkit/cloudflare-workers

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/cloudflare-workers@4338

@rivetkit/framework-base

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/framework-base@4338

@rivetkit/next-js

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/next-js@4338

@rivetkit/react

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/react@4338

rivetkit

pnpm add https://pkg.pr.new/rivet-dev/rivet/rivetkit@4338

@rivetkit/sql-loader

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/sql-loader@4338

@rivetkit/sqlite-vfs

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/sqlite-vfs@4338

@rivetkit/traces

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/traces@4338

@rivetkit/workflow-engine

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/workflow-engine@4338

@rivetkit/virtual-websocket

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/virtual-websocket@4338

@rivetkit/engine-runner

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/engine-runner@4338

@rivetkit/engine-runner-protocol

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/engine-runner-protocol@4338

commit: fbebf45

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