2.0 KiB
Prompt
User bug report from live ib testing of the (datad|brokerd)-split branch:
ok doing some testing and noticing live orders do not work otb, pikerd show this on live submission, [pdb traceback:
RuntimeError("Can not order {symbol}, no live feed?")atib/api.py:1152submit_limit()withself._contracts == {}in thebrokerd.ibactor + aTrioTaskExitedteardown cascade]
Follow-up user direction fixing the design intent:
i think the main thing here is that [brokerd] should be able to always submit orders without a live feed being up and registered in the same subactor right?
Response summary
Root cause: pre-split the feed code populated the actor-local Client._contracts cache (via get_mkt_info() writing mkt.bs_fqme keys) in the SAME process as order submission; post-split the trading actor’s client is never warmed. Fix: lazily qualify + cache the contract per order request in handle_order_requests() by running the same get_mkt_info(fqme, proxy=...) ep the feed side uses, plus per-order error relay (BrokerdError) so one bad submission can’t crash the whole trades dialog (the TrioTaskExited storm was teardown cascade from the original raise).
Files changed
piker/brokers/ib/broker.py— threadproxiesintohandle_order_requests(); lazy contract qualify on cache-miss; guardsubmit_limit()w/BrokerdErrorrelay; uncomment the (anticipatory)get_mkt_infoimportpiker/brokers/ib/api.py— fix the non-f-string raise msg + document the new qualification contract
Human edits
None — committed as generated. Live ib order retest performed by the human post-commit.