Repository navigation
fix(gold): retry a xenon leg once when its idle IB socket was reset - #554
Merged
Merged
Conversation
xenon answers 503 on the first request after its IB data socket dropped and reconnects on that request. XAUUSD is fetched first, so the nightly gold_factor_compute failed on prod twice in a row while the other six legs passed. fetch_ib_legs now retries a leg once, 5 s after SourceUnavailable.
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.
What
The nightly
gold_factor_computefailed on prod two runs in a row (job_failures.consecutive=2, last 17:46 ET 2026-10-13). Each time the first leg (XAUUSD) got a 503 from xenon and the other six legs got 200.Cause: xenon's
/historical/barsmapsConnectionErrorto 503 (xenon/api/routes/historical.py). When the idle IB data socket was reset, the first request hits it (ib_async ... [Errno 104] Connection reset by peerright before the 503 in the xenon log at 03:52 UTC 2026-10-14), and the pool reconnects for the next request.Fix:
fetch_ib_legsretries a leg once, 5 s afterSourceUnavailable. A second failure is still recorded and the job still raises.Checks
tests/unit/worker/test_gold_factor_fetch_retry.py(retry succeeds; second failure propagates)_lint_except,pytest tests/unit/3179 passed, gold factor job integration 4 passed