-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add priority field to queue #705
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I put a couple of comments regarding migration validation, besides that, everything looks good!
raise ValueError("priority should be 'normal'") | ||
|
||
check_documents(DocCls=JobSnapshot, sample_size=10, custom_validation=custom_validation) | ||
if JobSnapshot.objects(force=False).count() != JobSnapshot.objects.count(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't it be priority="normal" ?
|
||
check_documents(DocCls=JobSnapshot, sample_size=10, custom_validation=custom_validation) | ||
if JobSnapshot.objects(force=False).count() != JobSnapshot.objects.count(): | ||
raise ValueError('All the objects should have the "force" field, set to False') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also here 'All the objects should have the "priority" field, set to "normal"'
Codecov ReportBase: 90.40% // Head: 83.46% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #705 +/- ##
==========================================
- Coverage 90.40% 83.46% -6.95%
==========================================
Files 97 14 -83
Lines 4929 526 -4403
==========================================
- Hits 4456 439 -4017
+ Misses 473 87 -386
Flags with carried forward coverage won't be shown. Click here to find out more. Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
Only two values are allowed: normal and low. We don't use an int to make it easier for the moment.
cd8d03b
to
3de1315
Compare
Thanks for the review! |
Interesting: the db migration job failed, and rolled back to the previous state (I have tests, but hadn't seen it failing live 😅) it seems to work as intended: The deployment failed because the migration failed, ie. the new images have not been deployed because the database is not ready:
The logs of the migration job:
By the way, the bug is in the validation function, not in the migration itself... Nevermind, I'll fix it (comparison to enum object value instead of enum object) Another comment: it takes 3 minutes to add the field to all the jobs in the db! (and 8 minutes to delete!!) It's a lot. It's due to the size of the queue with the past jobs. At one time, I created too many useless jobs that were skipped afterward, and we have several billions of them that we will never use... Maybe just cleaning the queue and starting from scratch would be better. |
fixed in #707 |
In this PR:
priority
:normal
(default) orlow
normal
jobs are fetched before thelow
ones (but respectingmax_jobs_per_namespace
)