Description
registry.shutdown() can query _rivet_schedule_events after the actor SQLite transaction coordinator closes.
A minimal actor completed one durable workflow step. The registry then remained idle without an error. An explicit await registry.shutdown() caused transaction_closed while RivetKit synchronized the scheduled actor alarm.
The actor did not define a schedule, alarm, cron task, queue, or timer.
This shutdown reproduction is separate from the transient restart case in #5554.
Environment
- RivetKit:
2.3.11-rc.5
- Runtime: Node.js
24.4.1
- Platform: Linux x64
- Engine mode: serverful remote Engine
- Actor database: RivetKit embedded SQLite
@rivet-dev/agentos 0.2.15 was installed in the application. That package still declares an exact dependency on RivetKit 2.3.9. The application registry resolved the top-level 2.3.11-rc.5 package.
Reproduction sequence
- Define an actor with one durable workflow action.
- Start the registry with
await registry.startAndWait().
- Create the actor and run the workflow action.
- Confirm that the action completed.
- Keep the registry idle for at least 15 seconds.
- Call
await registry.shutdown().
- Observe a scheduled-alarm synchronization query after the SQLite coordinator closes.
I reproduced this result twice with 2.3.11-rc.5.
Observed result
The workflow completed before shutdown. RivetKit then logged this query during shutdown:
SELECT MIN(trigger_at) FROM _rivet_schedule_events
The native runtime returned:
error_code=transaction_closed
error_message="SQLite transaction coordinator is closed."
RivetKit then reported:
failed to sync scheduled actor alarm
Expected result
registry.shutdown() must stop scheduled-alarm synchronization before it closes the SQLite transaction coordinator.
The shutdown promise must resolve without a late database query or an error log.
Impact
The normal workflow completes. However, a pod restart or deployment cannot prove a clean Rivet shutdown. This blocks reliable graceful-termination and recovery claims.
Suspected ordering problem
The shutdown path appears to close the SQLite coordinator before all scheduled-alarm synchronization work stops.
Please confirm whether the driver alarm must stop before SQLite cleanup. A stable release with a deterministic shutdown test would resolve this production risk.
Description
registry.shutdown()can query_rivet_schedule_eventsafter the actor SQLite transaction coordinator closes.A minimal actor completed one durable workflow step. The registry then remained idle without an error. An explicit
await registry.shutdown()causedtransaction_closedwhile RivetKit synchronized the scheduled actor alarm.The actor did not define a schedule, alarm, cron task, queue, or timer.
This shutdown reproduction is separate from the transient restart case in #5554.
Environment
2.3.11-rc.524.4.1@rivet-dev/agentos0.2.15was installed in the application. That package still declares an exact dependency on RivetKit2.3.9. The application registry resolved the top-level2.3.11-rc.5package.Reproduction sequence
await registry.startAndWait().await registry.shutdown().I reproduced this result twice with
2.3.11-rc.5.Observed result
The workflow completed before shutdown. RivetKit then logged this query during shutdown:
The native runtime returned:
RivetKit then reported:
Expected result
registry.shutdown()must stop scheduled-alarm synchronization before it closes the SQLite transaction coordinator.The shutdown promise must resolve without a late database query or an error log.
Impact
The normal workflow completes. However, a pod restart or deployment cannot prove a clean Rivet shutdown. This blocks reliable graceful-termination and recovery claims.
Suspected ordering problem
The shutdown path appears to close the SQLite coordinator before all scheduled-alarm synchronization work stops.
Please confirm whether the driver alarm must stop before SQLite cleanup. A stable release with a deterministic shutdown test would resolve this production risk.