Skip to content

fix(engine): FIFO admission and drop-time drain in the command queue (#76) - #198

Merged
joaquinbejar merged 1 commit into
mainfrom
fix-197-queue
Oct 20, 2026
Merged

joaquinbejar merged 1 commit into
mainfrom
fix-197-queue

Conversation

@joaquinbejar

Copy link
Copy Markdown
Owner

Codex review of #197 (two P2s) and of #195 (a nit).

  • FIFO admission. With the ring full, a send already waiting could be overtaken forever by fresh sends that grabbed each freed slot first. A Logout could starve under sustained producers. A send now takes a slot from a tokio::sync::Semaphore with as many permits as the ring holds. The semaphore admits waiters in order, waits without allocating, and the receiver gives the permit back as it pops. close closes the semaphore, so waiting sends are refused.
  • Drop drains. Dropping the receiver now drops what is still queued, one command at a time, each after the lock is released. A Connection that outlives the session keeps no command or pooled buffer alive.
  • feat(core,tagvalue,engine): decode wide messages into lent field buffers (#77) #195 nit. The comment on FieldStore no longer claims the size is unchanged: the enum tag adds 8 bytes on aarch64 (840 to 848).

New unit tests:

  • test_a_waiting_send_is_admitted_before_later_ones;
  • test_dropping_the_receiver_drops_what_is_queued.

Both fail on the previous queue. The ready-gate allocation window stays at 0 blocks for 1024 sends.

cargo test --workspace --all-features: 2657 passed, 0 failed. fmt, clippy -D warnings, doc and check-spanish are clean. ADR-0008 updated.

Refs #76

@joaquinbejar joaquinbejar added bug Something isn't working session ironfix-session / store / transport / engine labels Oct 20, 2026
@joaquinbejar joaquinbejar self-assigned this Oct 20, 2026
@joaquinbejar
joaquinbejar merged commit 59775c3 into main Oct 20, 2026
25 of 35 checks passed
@joaquinbejar
joaquinbejar deleted the fix-197-queue branch October 20, 2026 17:46

@joaquinbejar joaquinbejar left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

APPROVE. Both PR197 findings are resolved. The original starvation and runtime shutdown buffer probes pass, alongside seven queue controls, four unchanged engine integration probes and ten authored queue tests. The allocation gate still measures zero blocks for 1024 ready gate sends. No new findings. Submitted as COMMENT because GitHub prevents the author account from approving its own pull request.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.85714% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
ironfix-engine/src/command_queue.rs 92.85% 1 Missing ⚠️
Files with missing lines Coverage Δ
ironfix-core/src/message.rs 84.37% <ø> (ø)
ironfix-engine/src/command_queue.rs 87.27% <92.85%> (-1.79%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working session ironfix-session / store / transport / engine

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants