Skip to content

gh-160735: Fix Gecko marker end times during binary replay - #160738

Merged
pablogsal merged 2 commits into
python:mainfrom
ivonastojanovic:gecko-replay-end-time
Nov 24, 2026
Merged

pablogsal merged 2 commits into
python:mainfrom
ivonastojanovic:gecko-replay-end-time

Conversation

@ivonastojanovic

Copy link
Copy Markdown
Contributor

Binary replay can deliver sample batches from different threads out of timestamp order. GeckoCollector used the final timestamp from the most recent batch, which could close open markers before they started.

Keep the latest timestamp seen across all batches and calculate the sample interval when serializing the profile.

Binary replay can deliver sample batches from different threads out of
timestamp order. GeckoCollector used the final timestamp from the most
recent batch, which could close open markers before they started.

Keep the latest timestamp seen across all batches and calculate the sample
interval when serializing the profile.
@ivonastojanovic

Copy link
Copy Markdown
Contributor Author

@pablogsal I also noticed that when we replay a binary profile with several threads, the exported interval gets divided by the thread count (4 threads at 1 ms show up as ~0.25 ms). Live sampling is fine since it gets all threads in one collect() call, but replay calls it once per thread batch. Gecko itself just writes the configured sampling interval there. Is this something we care about?

@pablogsal pablogsal added the needs backport to 3.15 bugs and security fixes label Nov 24, 2026

@pablogsal pablogsal left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for the Gecko fix, Ivona!

@pablogsal
pablogsal enabled auto-merge (squash) November 24, 2026 12:33
@pablogsal
pablogsal merged commit dc8ec9f into python:main Nov 24, 2026
62 checks passed
@miss-islington-app

Copy link
Copy Markdown

Thanks @ivonastojanovic for the PR, and @pablogsal for merging it 🌮🎉.. I'm working now to backport this PR to: 3.15.
🐍🍒⛏🤖

@bedevere-app

bedevere-app Bot commented Nov 24, 2026

Copy link
Copy Markdown

GH-162553 is a backport of this pull request to the 3.15 branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants