Skip to content

fix(core): Time out performance collection on a monotonic clock - #6739

Open
runningcode wants to merge 2 commits into
mainfrom
no/perf-collector-monotonic-timeout
Open

runningcode wants to merge 2 commits into
mainfrom
no/perf-collector-monotonic-timeout

Conversation

@runningcode

Copy link
Copy Markdown
Contributor

📜 Description

The 30s performance collection timeout in DefaultCompositePerformanceCollector now uses a Deadline on options.getMonotonicTicker() instead of comparing wall-clock readings.

At exactly 30s the collection now times out (Deadline.hasPassed() is inclusive), where it previously needed one tick more.

💡 Motivation and Context

A backward wall-clock step kept collection running past the timeout, and a forward step stopped it early. Found while reviewing #6591, which fixes the sample timestamps but leaves the timeout alone. This only changes how a duration is measured, not any timestamp the SDK sends.

#6589 edits the same run() block; whichever lands second needs a trivial rebase.

💚 How did you test it?

New unit tests step the wall clock forward and backward with TestMonotonicTicker; they fail on main.

📝 Checklist

  • I added GH Issue ID & Linear ID
  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.
  • Public API changes reviewed by another Mobile SDK team member or implemented according to the develop docs spec.

🔮 Next steps

🤖 Generated with Claude Code

runningcode and others added 2 commits November 23, 2026 11:21
The 30s collection timeout compared wall-clock readings, so a backward
clock step kept collection running past the timeout and a forward step
stopped it early. Measure it with a Deadline on the options' monotonic
ticker instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added the risk: medium PR risk score: medium label Nov 23, 2026
@github-actions

Copy link
Copy Markdown
Contributor

PR risk: medium

For commit f40309a.

Main concerns: reach, data sent to Sentry, host performance.

This label is a hint for reviewers, not an approval.

@sentry

sentry Bot commented Nov 23, 2026

Copy link
Copy Markdown

📲 Install Builds

Android

🔗 App Name App ID Version Configuration
SDK Size io.sentry.tests.size 8.65.0 (1) release

⚙️ sentry-android Build Distribution Settings

@runningcode
runningcode marked this pull request as ready for review November 23, 2026 10:36
@runningcode
runningcode requested review from a team and adinauer as code owners November 23, 2026 10:36
@runningcode
runningcode requested review from markushi and romtsn and removed request for a team November 23, 2026 10:36
@github-actions github-actions Bot added risk: medium PR risk score: medium and removed risk: medium PR risk score: medium labels Nov 23, 2026

This branch has not been deployed

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

Labels

risk: medium PR risk score: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant