-
-
Notifications
You must be signed in to change notification settings - Fork 286
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
Feature/add scheduler pid info #570
Merged
selwin
merged 21 commits into
rq:master
from
gabriels1234:feature/add-scheduler-pid-info
Mar 6, 2023
Merged
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
9c331ba
Add Scheduler info on main view
gabriels1234 23f0d20
Update utils.py
gabriels1234 9a3f734
Debugging
gabriels1234 01db5ab
Improve detection of running instance of scheduler
gabriels1234 e797d5f
Make rq-scheduler to return the pid
gabriels1234 32133f8
Update utils.py
gabriels1234 ee501b9
Add pid to rq-scheduler (option 1)
gabriels1234 60509f4
Fix pid is a property not method
gabriels1234 7160a0f
Fix Wording
gabriels1234 cb437f1
Decode pid for worker-scheduler
gabriels1234 5b38b70
Add better naming and Error handling.
gabriels1234 b21fb39
Add Tests
gabriels1234 7d10ee1
Improve get_scheduler_pid comments.
gabriels1234 120697f
Fix Tests for RQ-Scheduler's Scheduler() and RQ's RQScheduler()
gabriels1234 40b04fb
Fix for RQ-Scheduler's Scheduler behavior/tests
gabriels1234 9f6c30e
Remove unnecesary code
gabriels1234 1e3ff19
Remove scheduler_pid detection via redis' keys()
gabriels1234 0543def
Remove buggy support for rq-scheduler
gabriels1234 18aa46a
Fix Tests for RQ-Scheduler
gabriels1234 547f12a
Fix is Not in template
gabriels1234 f1671d1
Remove unused mock function.
gabriels1234 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
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.
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.
This will cause
get_scheduler_pid
to always returnFalse
ifrq_scheduler
is installed, even though the built in scheduler is used.I think we should just skip the check for external scheduler altogether.
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.
Well, ok. In my tests, running both --with-scheduler and rq-scheduler doesn't end up well.
By returning False, I'm basically disabling the feature, since it won't be shown in the dashboard.
After Some digging I found that, for some reason, rq and rq-scheduler organize scheduling and enqueuing of scheduled jobs in parallel ways, namely incompatible.
Please correct me if I'm wrong: Basically, jobs scheduled using Scheduler.enqueue_at will never be picked up by a worker --with-scheduler (different redis keys), and also the opposite is true. I wouldn't understand anyone having both running (and if they do, the worker will be worker only).
Recently, @cunla's django-rq-scheduler (>2022.12.1) transitioned to --with-scheduler.
My point is: showing that the Scheduler is active (worker --with-scheduler) and then scheduling jobs using rq-scheduler enqueue_at will cause stale jobs that never run and are never seen by django-rq.
What I propose is your original idea but only working if the rq-scheduler is not to be found, otherwise, the information would be misleading, to say the least.
Let me know
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.
@selwin as I mentioned, I prefer not to activate the feature for rq-scheduler, because it would be misleading.
I think the PR is ready to move forward. (At least to ship it as a half-feature)
However, I'm happy to make it according to your opinion.
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 agree, let's drop
rq-scheduler
altogether as it will only make things confusing.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.
@selwin great! So the PR is good as it is. do you need to see a screenshot?
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.
Yes please, a screenshot would be good just to make sure that it works :)