Skip to content
Prev Previous commit
Next Next commit
Cap RLE batch size to bound the per-batch timestamp list
  • Loading branch information
tonghuaroot committed Jul 2, 2026
commit 3e71061c1728f3b9093239f4e071037c79a97d7b
4 changes: 3 additions & 1 deletion Modules/_remote_debugging/binary_io_reader.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

/* Progress callback frequency */
#define PROGRESS_CALLBACK_INTERVAL 1000
#define MAX_RLE_BATCH_SAMPLES 8192 /* Cap per-batch samples to bound the timestamp list (gh-152089) */

/* ============================================================================
* BINARY READER IMPLEMENTATION
Expand Down Expand Up @@ -1095,7 +1096,8 @@ binary_reader_replay(BinaryReader *reader, PyObject *collector, PyObject *progre
ts->prev_timestamp += delta;

/* Start new batch on first sample or status change */
if (i == 0 || status != batch_status) {
if (i == 0 || status != batch_status
|| batch_idx >= MAX_RLE_BATCH_SAMPLES) {
Comment thread
pablogsal marked this conversation as resolved.
if (timestamps_list) {
int rc = emit_batch(state, collector, thread_id, interpreter_id,
batch_status, ts->current_stack, ts->current_stack_depth,
Expand Down
Loading