Skip to content

ccp: a matching-symbols request is recorded only when it was sent (ibx#369) - #383

Open
userFRM wants to merge 1 commit into
deepentropy:mainfrom
userFRM:fix/matching-symbols-pends-forever
Open

ccp: a matching-symbols request is recorded only when it was sent (ibx#369)#383
userFRM wants to merge 1 commit into
deepentropy:mainfrom
userFRM:fix/matching-symbols-pends-forever

Conversation

@userFRM

@userFRM userFRM commented Jul 31, 2026

Copy link
Copy Markdown

Problem

The request was pushed onto the pending queue whether or not it went out. The send error was discarded, and the push sat outside the block that needs a connection at all:

if let Some(conn) = ccp_conn.as_mut() {
    let _ = conn.send_fix(&[ ... ]);
    ...
}
self.pending_matching_symbols.push(req_id);

So a request issued while the CCP transport was down was queued as pending with nothing on the wire to answer it.

Nothing expired the queue either. An unanswered request stayed in it for the life of the process — and the reply matcher falls back to the head of that queue when a reply carries no echoed request id, so a stale entry could absorb a later request's answer. That is the failure #228 fixed for a different cause.

What this changes

A request is recorded only where it was sent, and carries a deadline after which it is given up on — matching what historical requests already do, since both are one round trip to the gateway.

What this does not do

A request that could not be sent is logged and not recorded. Surfacing that to the caller would need an error channel this request type does not have: the reply arrives through the symbol-samples callback and there is nothing beside it to carry a failure.

Tests

  • a_matching_symbols_request_that_was_not_sent_is_not_recorded — with no transport, nothing is awaited; with one, it is.
  • an_unanswered_matching_symbols_request_is_given_up_on — the expired entry is dropped and the live one kept.

Each fails by name against a compiling reversion of the production line it covers.

Closes #369.

Test plan

  • Mutation: recording the request with no transport fails a_matching_symbols_request_that_was_not_sent_is_not_recorded by name.
  • Mutation: never expiring an entry fails an_unanswered_matching_symbols_request_is_given_up_on — anchored on the intended sweep, since the file contains a second deadline check.
  • The existing reply-attribution tests were updated to the deadline-carrying queue and still pass.
  • cargo check --offline clean on --lib, --lib --features python, --bins, --examples, and each integration target individually.
  • tests/ib_paper_compat compared against a clean checkout of the base commit — identical sorted diagnostic sets.
  • cargo test --offline --lib — only the two known config::expiry_tests failures, which fail on the base commit for missing legacy tzdata (fixed separately in config: resolve the legacy timezone names IB states its times in (ibx#335) #336).

The request was pushed onto the pending queue whether or not it went out. The send error was discarded, and the push sat outside the block that needs a connection at all — so a request issued while the CCP transport was down was queued as pending with nothing on the wire to answer it.

Nothing expired the queue either. An unanswered request stayed in it for the life of the process, and the reply matcher falls back to the head of that queue when a reply carries no echoed request id — so a stale entry could absorb a later request's answer, which is the failure deepentropy#228 fixed for a different cause.

A request is now recorded only where it was sent, and carries a deadline after which it is given up on, matching what historical requests already do. Both are one round trip to the gateway.

A request that could not be sent is logged and not recorded. Surfacing that to the caller would need an error channel this request type does not have — the reply arrives through the symbol-samples callback and there is nothing beside it to carry a failure.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ccp: a matching-symbols request is recorded as pending even when it was never sent, and nothing times it out

1 participant