-
-
Notifications
You must be signed in to change notification settings - Fork 750
Revisit Scheduler.add_plugin / Scheduler.remove_plugin
#5394
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
Conversation
|
XREF #5120 |
douglasdavis
left a comment
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.
Everything makes sense to me and I think it looks good; if @jrbourbeau gets a chance to take a look I think that would be a good idea since he recently reviewed the plugin PR I worked on
jrbourbeau
left a comment
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.
Thanks @crusaderky!
This seems reasonable to me. Out of curiosity, what motivated this change? Was there something in particular you ran across?
| if idempotent: | ||
| return |
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.
Thanks for moving this here. It looks like we were emitting a warning when we shouldn't have been before.
distributed/scheduler.py
Outdated
| if not names: | ||
| return |
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'd prefer to error here instead of silently returning when a user asks to remove a non-registered plugin
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.
Now both deprecated and new code raise ValueError.
Passing a plugin class to add_plugin did not make sense, as it was creating the instance with the scheduler as the first positional parameter which most plugin classes won't accept. |
|
All review comments have been incorporated |
jrbourbeau
left a comment
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.
Thanks @crusaderky!
Scheduler.add_plugin / Scheduler.remove_plugin
Deprecate adding plugins by type: the scheduler positional argument is only accepted by some plugins and it's undocumented.
Harden the logic of add_plugin and remove_plugin.