Repository navigation
Use monotonic uptime clock for idle tracking and activity stop waits. - #2521
Merged
Merged
Conversation
copybara-service
Bot
force-pushed
the
piper_1008793370
branch
2 times, most recently
from
October 29, 2026 09:35
c481094 to
b528bc3
Compare
`MonitoringInstrumentation` previously used `System.currentTimeMillis()` to record `lastIdleTime` when the main looper became idle and to bound the 2s polling loop in `waitForActivitiesToComplete()`. Because `System.currentTimeMillis()` follows wall-clock time, backward clock adjustments (such as an NTP sync on device) can cause `waitForActivitiesToComplete()` to block for the duration of the backward jump when an activity has not stopped yet, while forward clock jumps can cause the loop to exit before waiting the full 2s timeout. Wall-clock jumps also skew the `lastIdleTime` values reported when `startActivitySync()` times out. Replace `System.currentTimeMillis()` with `SystemClock.uptimeMillis()` in `MonitoringInstrumentation` so that activity completion timeouts and looper idle timestamps are measured against a monotonic clock. PiperOrigin-RevId: 1009540928
copybara-service
Bot
force-pushed
the
piper_1008793370
branch
from
October 29, 2026 09:44
b528bc3 to
43ce8c3
Compare
|
Dude you4 fucking badass
…On Thu, Oct 29, 2026, 4:45 AM copybara-service[bot] < ***@***.***> wrote:
Merged #2521 <#2521> into
main.
—
Reply to this email directly, view it on GitHub
<#2521?email_source=notifications&email_token=CRHT4TRJ5E2YBXL56KOMH7L5WMGUPA5CNFSNUABQM5UWIORPF5TWS5BNNB2WEL2JONZXKZKFOZSW45CON52GSZTJMNQXI2LPNYXTGNBVGY4TGOJVGAYDBJTSMVQXG33OVJZXKYTTMNZGSYTFMSSWK5TFNZ2KYZTPN52GK4S7MNWGSY3L#event-34569395000>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/CRHT4TTJDI4PMBM5MJP2WO35WMGUPAVCNFSNUABEKJSXA33TNF2G64TZHM2DCMJUHA2DSNB3JFZXG5LFHM3DAOBQGI4TMNJSHCQXMAQ>
.
Triage notifications, keep track of coding agent tasks and review pull
requests on the go with GitHub Mobile for iOS
<https://github.com/notifications/mobile/ios/CRHT4TSNOS7ZMLV2GOJYZ4T5WMGUPA5CNFSNUABQM5UWIORPF5TWS5BNNB2WEL2JONZXKZKFOZSW45CON52GSZTJMNQXI2LPNYXTGNBVGY4TGOJVGAYDBJTSMVQXG33OVJZXKYTTMNZGSYTFMSSWK5TFNZ2KUZTPN52GK4S7NFXXG>
and Android
<https://github.com/notifications/mobile/android/CRHT4TU7SFAOR2TJCITOZST5WMGUPA5CNFSNUABQM5UWIORPF5TWS5BNNB2WEL2JONZXKZKFOZSW45CON52GSZTJMNQXI2LPNYXTGNBVGY4TGOJVGAYDBJTSMVQXG33OVJZXKYTTMNZGSYTFMSSWK5TFNZ2K4ZTPN52GK4S7MFXGI4TPNFSA>.
Download it today!
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Use monotonic uptime clock for idle tracking and activity stop waits.
MonitoringInstrumentationpreviously usedSystem.currentTimeMillis()to recordlastIdleTimewhen the main looper became idle and to bound the 2s polling loop inwaitForActivitiesToComplete(). BecauseSystem.currentTimeMillis()follows wall-clock time, backward clock adjustments (such as an NTP sync on device) can causewaitForActivitiesToComplete()to block for the duration of the backward jump when an activity has not stopped yet, while forward clock jumps can cause the loop to exit before waiting the full 2s timeout. Wall-clock jumps also skew thelastIdleTimevalues reported whenstartActivitySync()times out.Replace
System.currentTimeMillis()withSystemClock.uptimeMillis()inMonitoringInstrumentationso that activity completion timeouts and looper idle timestamps are measured against a monotonic clock.