extract Execution and close the job lifecycle (#2360, goal 2) - #2560
Open
ebuzerdrmz44 wants to merge 1 commit into
Open
ebuzerdrmz44 wants to merge 1 commit into
ebuzerdrmz44 wants to merge 1 commit into
Conversation
…gh their full lifecycle
Contributor
Author
|
Hey @m3nu, I do not feel strong for the type column , but would be there any new job type rather than backup in the future ? It also runs prune , check and compact after a backup but these only go to event log . |
This branch has not been deployed
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
Follows #2558, which split out Scheduling and State. This takes out the third piece:
create_backup,notifyandpost_backup_tasksmove intoscheduler/execution.pyasSchedulerExecution, same collaborator shape as the other two.It also makes the scheduler record runs that actually happen. Until now only
record_skipwroteJobModelrows, so the table held runs that didn't run and the Jobs page never showed a completed backup.record_startandrecord_finishsit next to it in State. A run is written asrunning, then settled ascompletedorfailedwith itsEventLogModelrow linked, which is the intent/result link from goal 1 of the issue. Failed runs store the worst message Borg logged as the reason, so the Reason column is filled the way it already is for skips.Screenshot
An example of 'running' row
Submitting a run also drops the timer entry that fired it, otherwise the page listed the same run twice while it was in flight, once as a stale
scheduledrow and once asrunning.notifyre-arms the timer as before.recover_interrupted_jobsmarks rows left atrunningasinterrupted. I put it ininit_dbnext to the existingJobModelpurge rather than in the scheduler: it has to run once per process, and hanging it offVortaScheduler.__init__meant a second scheduler could flip a live run. That answers open question 3 in the issue. Let me know if you would rather it retried those runs instead of just recording them.Manual backups still bypass the scheduler, so they stay off the table. (not sure if they supposed to be in this tab , let me know if you want it )
Jobs page filtering is the last open bullet of goal 3 and is coming as its own PR next.