Skip to content

Tachyon: GeckoCollector closes open markers too early when replay batches arrive out of order #160735

Done

Description

@ivonastojanovic

Bug report

GeckoCollector.collect() sets last_sample_time to the last timestamp of the most recent call, not the latest one seen. During binary replay, batches from different threads can arrive out of time order, so markers get closed too early and can even end before they start.

from _remote_debugging import FrameInfo, InterpreterInfo, LocationInfo, ThreadInfo
from profiling.sampling.gecko_collector import GeckoCollector

collector = GeckoCollector(1000)
frames = [FrameInfo(("t.py", LocationInfo((1, 1, 0, 0)), "f", None))]
# Thread 2's last batch arrives after thread 1's, as binary replay can deliver them
for tid, timestamps in [(1, [1000]), (2, [1500]), (1, [3000, 4000]), (2, [2500])]:
    collector.collect([InterpreterInfo((0, [ThreadInfo((tid, 0, frames))]))],
                      timestamps_us=timestamps)
print(collector.last_sample_time)  # 1.5, should be 3.0

CPython versions tested on:

3.15, CPython main branch, 3.16

Operating systems tested on:

macOS

Linked PRs

Activity

  1. added
    type-bug
    on Oct 26, 2026
  2. added
    stdlib
    on Oct 27, 2026
  3. added 2 commits that reference this issue on Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

stdlibtopic-profilingtype-bug

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions