[AI-generated]Include Prepared phase tasks in periodic enqueue to prevent stalling #9449
+12
−0
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.
This is an alternative proposed solution to the issue described in #9447
Problem
Tasks in Prepared phase were not included in periodic enqueue (only Accepted phase was included). This meant they only received reconcile calls through watch events, which could cause them to get stuck for long periods when waiting for available slots.
Solution
This change adds Prepared phase to the periodic enqueue predicate for both DataUpload and DataDownload controllers, ensuring they get regular reconcile calls (every minute via preparingMonitorFrequency). This guarantees that tasks in Prepared phase will receive reconcile calls regularly, allowing them to check for available slots and proceed when slots become available.
Changes
Alternative Approach
This is a simpler alternative to the slot reservation mechanism proposed in PR #9447. While PR #9447 focuses on optimizing the reconcile logic itself, this PR ensures tasks get regular reconcile calls in the first place.