schedule runs beyond QTimer's 24.8 day ceiling (#2360, phase 3) - #2547
Open
ebuzerdrmz44 wants to merge 4 commits into
Open
schedule runs beyond QTimer's 24.8 day ceiling (#2360, phase 3)#2547ebuzerdrmz44 wants to merge 4 commits into
ebuzerdrmz44 wants to merge 4 commits into
Conversation
…he pause after a failed backup
…work in the profile deletion test
…e timer in chunks
Contributor
Author
|
@m3nu Only the last commit, Just this PR's change: bb8be7d
|
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.
Description
Phase C of #2360. Stacked on #2532, which is where
_set_pauseand its clamp come from.A
QTimerinterval is a C++int, so one wait tops out at2**31 - 1ms, about 24.855 days. Two places hit that, each worked around differently.set_timer_for_profilestoresTOO_FAR_AHEADwith no timer and leaves the 15 minute poll to pick the profile up once the wait fits. The unit list offers weeks and the count spinbox goes to 740, so4 weeksreaches this from the UI, andnext_jobskips entries with no activeqtt, so the tray reads "None scheduled" for three days after each run while the schedule page shows the correct date beside it. A yearly schedule sits that way for eleven months. The run is not lost, just imprecise._set_pauseclamps instead. Apaused_untilread back after a clock correction fires 24.8 days in,set_timer_for_profilefinds the pause still running and re-marks it without arming anything, so the repeating timer ends it up to another 24.8 days late.The fix
arm_deadline_timer(deadline, on_expiry)replaces both: a single-shot timer of at mostMAX_TIMER_MSthat recomputes the remainder against the wall clock on each expiry and re-arms until the deadline has passed.TOO_FAR_AHEADloses its writer and comes out with its branch inschedule_page.Measuring per chunk also absorbs
CoarseTimer's 5% early fire, which the old single interval had nothing to catch, and lets a chunk spanning a suspend extend itself instead of running late.A deadline already in the past arms a zero length timer rather than calling back inline, which keeps
set_timer_for_profilefrom re-enteringself.lockthroughcreate_backup.Notes
_set_pausenow stops the timer it replaces. Overriding a pause always orphaned the old one, harmlessly, because nothing held a reference to it afterwards. The chunked timer keeps a cycle through its owntimeoutconnection, so an orphan would now outlive collection and fire one spurious reschedule.+ 100.pending_jobson add a Jobs view: pending runs and recorded jobs in one table (#2360, phase 4) #2538 listsSCHEDULEDandTOO_FAR_AHEAD. Whichever lands second drops that one line.