Repository navigation
Conversation
PR risk: mediumFor commit Main concerns: public contract, data sent to Sentry, host performance. Rules that block low also fired:
This label is a hint for reviewers, not an approval. |
|
📲 Install BuildsAndroid
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want fixes drafted automatically? Bugbot Autofix can create code changes for findings. A team admin can enable Autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit a19a7c8. Configure here.
| try { | ||
| if (!onDisk) { | ||
| onDisk = true; | ||
| startDiskRecording(manager); |
There was a problem hiding this comment.
Failed flush skips buffered samples
Medium Severity
onDisk is set before startDiskRecording finishes, so an IOException from clear or a later add still marks the hang as flushed. Later ticks then append only the new sample. If clear failed, that appends onto the previous hang; if clear succeeded, the in-memory buffer never reaches the file. The fatal ANR path can then load mixed or truncated stacks.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit a19a7c8. Configure here.
|
|
||
| final long epochMs = NANOSECONDS.toMillis(epochClock.now().epochNanos()); | ||
| final @NotNull AnrStackTrace sample = | ||
| new AnrStackTrace(epochMs, thread.getStackTrace(), thread.getState()); |
There was a problem hiding this comment.
Sample timestamps use wall clock
Low Severity
Each sample stamps itself with a fresh epochClock.now() reading. Those timestamps are later sorted and turned into profile sample times, so they are related instants. A wall-clock jump during the hang can reorder stacks or stretch the profile. AnchoredClock is the type for this: one epoch read, then monotonic ticks for the rest.
Triggered by learned rule: AnchoredClock for related instants, not EpochClock math
Reviewed by Cursor Bugbot for commit a19a7c8. Configure here.


Adds
ThreadSampleCollector: it samples the stack of the watched thread during a hang interval and writes the samples to the ANR profile file after 700 ms. Not wired yet.Design: Non-Fatal ANR Architecture (JAVA-777)
🤖 Generated with Claude Code
#skip-changelog