• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

databendlabs / openraft / 18443998704

12 Oct 2025 11:24AM UTC coverage: 91.281% (+0.1%) from 91.158%
18443998704

push

github

drmingdrmer
improve: implement non-blocking Respond queue

Introduce a separate queue system for pending responds to prevent
blocking the main command queue. Responds are now queued based on
their waiting conditions (log IO flushed, log applied, snapshot
built) and sent when conditions are satisfied.

Add `PendingResponds` struct with four queues (`on_log_io`,
`on_log_flush`, `on_apply`, `on_snapshot`) to hold responds
waiting for different IO completion events. Implement
`drain_satisfied()` iterator that checks current IO state and
yields responds whose conditions are met.

Add `send_satisfied_responds()` method to `RaftCore` that
periodically checks and sends all satisfied responds. This method
is called in the command processing loop to ensure responds are
sent promptly when conditions become satisfied.

Simplify condition checking by adding `Condition::is_met()` method
that encapsulates the logic for checking if IO state satisfies a
condition. Remove duplicated condition checking code from
`run_command()`.

Change `Condition` enum variants to use non-optional `LogId` values
since conditions always require specific log IDs to wait for.
Update `Condition::Display` to show threshold comparisons using
">=" operator for clarity.

Add `CommandKind::Respond` variant to classify respond commands
separately, enabling parallel execution with other command types.

285 of 298 new or added lines in 7 files covered. (95.64%)

4 existing lines in 2 files now uncovered.

11726 of 12846 relevant lines covered (91.28%)

113768.44 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

81.88
/openraft/src/engine/command.rs


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc