fix: submission_status_cleanup recovers all non-terminal states#2414
Open
hanane-ca wants to merge 1 commit into
Open
fix: submission_status_cleanup recovers all non-terminal states#2414hanane-ca wants to merge 1 commit into
hanane-ca wants to merge 1 commit into
Conversation
…just Running Extend cleanup to cover Submitted, Preparing, Running, and Scoring. Use created_when as fallback when started_when is null (submissions that never reached Running). Add 4 unit tests covering the new states and a negative test for recent submissions. Fixes codalab#2413
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.
Fixes #2413
Problem
submission_status_cleanup()only filtersstatus=Running, so submissions stuck inSubmitted,Preparing, orScoringare never recovered by the periodic cleanup. They hang indefinitely and consume quota permanently.The existing
started_whencheck also fails for submissions that never reachedRunning(nullstarted_when).Changes
src/apps/competitions/tasks.py: extend filter fromstatus=Runningtostatus__in=[Submitted, Preparing, Running, Scoring]created_whenas fallback reference time whenstarted_whenis nullsrc/apps/competitions/tests/test_submissions.py: add 4 unit tests for the new cleanup coverage + 1 negative test ensuring recent submissions are not prematurely cleanedTesting
All 6 tests pass: