Skip to content

Conversation

@crusaderky
Copy link
Collaborator

@crusaderky crusaderky commented Oct 6, 2021

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.

@crusaderky crusaderky mentioned this pull request Oct 6, 2021
@crusaderky
Copy link
Collaborator Author

XREF #5120
CC @douglasdavis

Copy link
Member

@douglasdavis douglasdavis left a 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

Copy link
Member

@jrbourbeau jrbourbeau left a 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?

Comment on lines +5484 to +5485
if idempotent:
return
Copy link
Member

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.

Comment on lines 5526 to 5527
if not names:
return
Copy link
Member

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

Copy link
Collaborator Author

@crusaderky crusaderky Oct 7, 2021

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.

@crusaderky
Copy link
Collaborator Author

what motivated this change? Was there something in particular you ran across?

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.

@crusaderky
Copy link
Collaborator Author

All review comments have been incorporated

Copy link
Member

@jrbourbeau jrbourbeau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @crusaderky!

@jrbourbeau jrbourbeau changed the title Revisit add_plugin / remove_plugin Revisit Scheduler.add_plugin / Scheduler.remove_plugin Oct 7, 2021
@jrbourbeau jrbourbeau merged commit 8fa3854 into dask:main Oct 7, 2021
@crusaderky crusaderky deleted the add_plugin branch October 11, 2021 11:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants