gateway: take the farm channel role from the slot, not the farm name (ibx#253) - #255
gateway: take the farm channel role from the slot, not the farm name (ibx#253)#255userFRM wants to merge 1 commit into
Conversation
|
Reworked. The first revision keyed the role off the farm name, and the name is not a reliable discriminator.
The caller never needed to guess. Also fixed: my previous insertion split Still not established by this repo: that channel 2 is right for regional HMDS specifically. Tag 6171 assigns slot 17 for every region, so it follows that the routing request should match — but the only direct evidence for the value 2 is the original |
d10dfa8 to
6348456
Compare
6348456 to
7d677fd
Compare
…(ibx#253) `connect_farm` picked the routing channel with `if farm_id == "ushmds"`, so a regional historical-data farm — `euhmds` on an EU-routed account — fell through to channel 1, the trading channel, while completing logon and looking established. The name is the wrong discriminator. Routing tags carry whatever the server sends, and this codebase already connects `cashhmds` on the trading slot, so a suffix rule gets that one wrong in the other direction. The caller does not need to guess: it splits trading from market-data farms at the call site and already passes the slot as the last argument, 18 and 17 respectively. `farm_channel_id` now reads that slot, and the two literals the call sites pass are named. Every farm on slot 17 takes channel 2 regardless of region or name, and everything else stays on channel 1. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
7d677fd to
23df2fc
Compare
Summary
connect_farmderived the farm's channel role from a literal US name (src/gateway.rs:510):if farm_id == "ushmds" { "2" } else { "1" }. Every regional HMDS name fell to theelseand requested channel 1, the trading channel, for a historical-data transport.parse_farm_routehandles regional routes with a test forzdc1.ibllc.com/euhmds/4000, and the comments at:1197and:1607state that EU accounts route toeufarm/euhmds/secdefeu. The role check was the one place that still assumed US.farm_channel_id, keyed on thehmdssuffix, soushmds,euhmdsandaphmdsall take channel 2 and everything else stays on 1.Test
hmds_farms_take_the_data_channel_in_every_regionpins the mapping for all three HMDS regions plususfarm,eufarmandsecdefeu. It is a free function besideparse_farm_route, so the mapping is testable without standing up a socket — which is why it had no coverage before.cargo test --lib— 803 pass, clippy clean. The twoconfig::expiry_testsfailures are present onmainbefore this branch.Not verified live
I have a US-routed account, so the EU path is unexercised here. The change is a pure widening:
ushmdskeeps the exact value it had, and only names that previously got the trading channel by accident are affected.Test plan
cargo test --offline --lib— 803 passed. The 2 failures areconfig::expiry_tests::{named_zone_converts_with_dst, instant_round_trips_to_wire}, which fail on the base commit too: the host has no legacy timezone files (fixed separately in config: resolve the legacy timezone names IB states its times in (ibx#335) #336).cargo check --offline --features python— clean.🤖 Generated with Claude Code