ccp: a matching-symbols request is recorded only when it was sent (ibx#369) - #383
Open
userFRM wants to merge 1 commit into
Open
ccp: a matching-symbols request is recorded only when it was sent (ibx#369)#383userFRM wants to merge 1 commit into
userFRM wants to merge 1 commit into
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
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
a_matching_symbols_request_that_was_not_sent_is_not_recordedby name.an_unanswered_matching_symbols_request_is_given_up_on— anchored on the intended sweep, since the file contains a second deadline check.cargo check --offlineclean on--lib,--lib --features python,--bins,--examples, and each integration target individually.tests/ib_paper_compatcompared against a clean checkout of the base commit — identical sorted diagnostic sets.cargo test --offline --lib— only the two knownconfig::expiry_testsfailures, 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).