Skip to content

get_historical_time_bars deadlocks with LOCK TIMEOUT on 1-min bar fetch #54

@rosabalw

Description

@rosabalw

Environment

  • Python 3.11 (arm64 Windows)
  • async_rithmic version: <PASTE OUTPUT OF pip show async_rithmic>
  • System: Rithmic Paper Trading (rprotocol.rithmic.com:443)

Bug

Calling get_historical_time_bars() with wait=True or wait=False
using keyword-arg form hangs and emits repeating [LOCK TIMEOUT] Failed to acquire lock after 5.00s errors from helpers/concurrency.py:29.
The blocking context is send_and_recv_immediate_202 and the waiting
context is _recv_loop.

Reproducible snippet

from async_rithmic.protocol_buffers import request_time_bar_update_pb2 as _bar_pb
MINUTE_BAR = _bar_pb.RequestTimeBarUpdate.BarType.MINUTE_BAR

await client.get_historical_time_bars(
    symbol="NQM6",
    exchange="CME",
    start_time=start_utc,
    end_time=now_utc,
    bar_type=MINUTE_BAR,
    bar_type_periods=1,
    wait=False,
)

Expected

Per docs (https://async-rithmic.readthedocs.io/en/latest/historical_data.html),
the call should return a list of bars.

Actual

Hangs with LOCK TIMEOUT. Both wait=True and wait=False reproduce.

Workaround

Using the documented positional form works:

bars = await client.get_historical_time_bars(
    "NQM6", "CME", start_utc, now_utc, TimeBarType.MINUTE_BAR, 1
)

So this may be a keyword-argument dispatch bug.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions