refactor(consensus): Delete Engine Task Queue#2538
Conversation
|
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.
b24924e to
e9568bc
Compare
0519c51 to
134b7c4
Compare
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>
2dadbb3 to
6d83e9f
Compare
| .await; | ||
|
|
||
| self.state_sender.send_replace(self.state); | ||
| Metrics::engine_task_count(Metrics::INSERT_TASK_LABEL).increment(1); |
There was a problem hiding this comment.
engine_task_count is incremented unconditionally here (on both success and failure), but the metric is described as "Engine operations successfully executed" and retry_with_severity only increments it on success (line 294). This will inflate the success counter for failed local inserts.
| Metrics::engine_task_count(Metrics::INSERT_TASK_LABEL).increment(1); | |
| if result.is_ok() { | |
| Metrics::engine_task_count(Metrics::INSERT_TASK_LABEL).increment(1); | |
| } |
Move repeated EngineClient bounds into the existing where clauses so clippy no longer reports multiple bound locations. Co-authored-by: Codex <noreply@openai.com>
Remove the remaining SealTask wrapper and fold started-payload sealing into direct Engine methods. Rename the private task_queue module to operations and update stale queue-era docs and metrics. Co-authored-by: Codex <noreply@openai.com>
Review SummaryClean refactor that removes the engine task queue abstraction in favor of direct operations on Issues (2 findings, both covered by existing inline comments)
No new findings beyond the existing inline comments. |
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.