refactor(consensus): Delete Engine Task Queue#2538
refactor(consensus): Delete Engine Task Queue#2538refcell wants to merge 1 commit intorf/refactor/direct-engine-forkchoice-finalizefrom
Conversation
Delete the remaining engine priority queue, task enum, trait dispatch, enqueue, drain, and thin delegated/finalize wrappers. Make Engine a non-generic state owner with generic direct methods, and keep only a small severity helper plus processor-local operation error mapping for reset/flush/critical handling. Co-authored-by: Codex <noreply@openai.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
| Self::QueueLengthReceiver(subscription) => { | ||
| let (_, queue_length_recv) = tokio::sync::watch::channel(0); | ||
| subscription | ||
| .send(queue_length_recv) | ||
| .map_err(|_| EngineQueriesError::OutputChannelClosed) | ||
| } |
There was a problem hiding this comment.
The sender (_) from watch::channel(0) is immediately dropped. When the dev RPC subscriber calls wait_for on this receiver (in dev.rs:80), it will get Err(RecvError) immediately because the sender is gone, causing the subscription loop to exit and log a "Subscription to engine queue size has been closed" warning on every subscription attempt.
If this is intentional stub behavior for a deprecated API, consider either:
- Documenting why the sender is intentionally dropped (e.g., a comment explaining the legacy stub), or
- Keeping the sender alive so the subscription hangs (returning
0forever) rather than erroring out — which might be friendlier to existing callers expecting a live subscription.
Review SummaryClean refactor that removes the Findings:
No other correctness, safety, or concurrency issues found. The retry-on-temporary-error loops that previously lived in the deleted |
Summary
Delete the remaining engine priority queue, task enum, trait dispatch, enqueue, drain, and delegated/finalize wrapper structs. The engine processor now publishes direct-operation state changes without a pre-drain step, and Engine is a non-generic state owner with generic methods for the client-specific calls. The legacy dev queue-length RPC now reports zero without carrying queue state through the engine actor.