[Interactive Brokers] Trade, realtime bar and market depth streams end with no log line

Author: Artur-SulejCreated Sep 8, 2026Updated Sep 29, 2026

Bug Report

Confirmation

  • I've re-read the relevant sections of the documentation.
  • I've searched existing issues and discussions to avoid duplicates.
  • I've reviewed or skimmed the source code (or examples) to confirm the behavior is not by design.
  • I've tested this issue using a recent pre-release or development wheel (2.0.0rcN, dev develop, or a nightly) and can still reproduce it.

Tested on 2.0.0rc4. The relevant code is identical on develop HEAD, at the same line numbers.

Expected behavior

When an Interactive Brokers market data subscription stream ends, the adapter emits a log line, as the quote, option greeks and index price paths already do.

Actual behavior

Three of the six stream handlers in core_streams.rs terminate completely silently. A market data stream can end and the node continues with no trace in the logs at any level, including TRACE.

The asymmetry is visible within the single file:

Stream Line (rc4 and develop) On stream end
process_quote_stream 719 tracing::debug!("Quote subscription stream ended for {}", instrument_id)
option greeks 822 tracing::debug!(...)
index price 923 tracing::debug!(...)
process_trade_stream 1309 silent
process_realtime_bar_stream 1409 silent
process_market_depth_stream 1528 silent

Steps to reproduce

This is a source-level asymmetry rather than something that needs a runtime trigger. The three silent paths have no log statement on the None arm, so no configuration of log levels can surface the event.

Code snippets or logs

crates/adapters/interactive_brokers/src/data/core_streams.rs:

rust
// process_trade_stream, line 1309
None => return Ok(StreamAction::Stop),

// process_realtime_bar_stream, line 1409
None => return Ok(StreamAction::Stop),

// process_market_depth_stream, line 1528
None => return Ok(StreamAction::Stop),

versus the quote path at line 719:

rust
let Some(tick_result) = tick_result else {
    tracing::debug!("Quote subscription stream ended for {}", instrument_id);
    break;
};

Why it matters

We spent a session diagnosing a mid-day loss of trade ticks across five instruments. Part of what made it slow is that a stream which has ended is indistinguishable from a stream that is open but delivering nothing, because neither produces any log output. For market data feeding a live strategy, an ended subscription is an operationally serious event.

Suggested fix

Add parity logging to the trade, realtime bar and market depth paths.

Separately, and for maintainers to judge: debug! seems low for all six of these paths. A market data subscription ending unexpectedly mid-session is not routine, and warn! would make it visible at default log levels. I am happy to open a PR for either the narrow parity fix or the level change.

Specifications

  • OS platform: macOS-26.6.2-arm64-arm-64bit-Mach-O
  • Python version: 3.13.15
  • nautilus_trader version: 2.0.0rc4
  • Installed from: PyPI wheel
  • Adapter/venue: Interactive Brokers (TWS paper, API v178)

Source: nautechsystems/nautilus_trader