Fix backup button staying greyed out after job completion (#2339)#2347
Merged
Fix backup button staying greyed out after job completion (#2339)#2347
Conversation
The backup_finished_event signal was emitted from within job.run(), but is_worker_running() checked Thread.is_alive() which returned True because the thread hadn't exited yet. This race condition caused the UI buttons to remain disabled after backup completion. Fix by clearing current_job after job.run() returns and checking both is_alive() and current_job in is_worker_running(). This correctly detects job completion even while the thread is still alive.
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.
Summary
Fixes #2339 - After a backup completes successfully, the "Start Backup" button stays greyed out despite the status showing "Finished Backup".
Root Cause: The
backup_finished_eventsignal is emitted from withinjob.run(), butis_worker_running()checksThread.is_alive()which returnsTruebecause the thread hasn't fully terminated yet. This race condition causes buttons to remain disabled.Fix: Clear
current_jobafterjob.run()returns and check bothis_alive()ANDcurrent_job is not Noneinis_worker_running(). This correctly detects job completion even while the thread is technically still alive.Changes
SiteWorker.run(): Clearcurrent_job = Noneafter job completesis_worker_running(): Check both thread liveness and current_job statecancel_all_jobs(): Guard against None current_jobTest plan