Pass stimulus_id to SchedulerPlugin.remove_worker and SchedulerPlugin.transition#7974
Conversation
stimulus_id in SchedulerPlugin.remove_worker and SchedulerPlugin.transition`stimulus_id to SchedulerPlugin.remove_worker and SchedulerPlugin.transition
jrbourbeau
left a comment
There was a problem hiding this comment.
Thanks @hendrikmakait. This will break existing plugins that have a transition and/or remove_worker method. Can we make stimulus_id optional such that existing plugins continue to work?
I'm not sure if we can do this nicely. The problem is that some plugins might accept it as a keyword, others might not, so (I think) we'd have to resort to introspection, which is rather cumbersome. distributed/distributed/scheduler.py Lines 1981 to 1993 in 8e92b85 DeprecationWarning if stimulus_id is not supported, but I'd rather want to avoid this long-term.
|
Unit Test ResultsSee test report for an extended history of previous test failures. This is useful for diagnosing flaky tests. 13 files - 7 13 suites - 7 6h 31m 30s ⏱️ - 4h 48m 26s For more details on these failures, see this check. Results for commit de43494. ± Comparison against base commit 8e3e0f6. This pull request skips 2 tests.♻️ This comment has been updated with latest results. |
|
@jrbourbeau: I've added a FutureWarning for |
|
The entire purpose of Alerting about the content of kwargs seems counterintutive to me. If somebody cares aobut this, they should specify it as a proper argument |
| def remove_worker( | ||
| self, scheduler: Scheduler, worker: str | ||
| self, scheduler: Scheduler, worker: str, *, stimulus_id: str | ||
| ) -> None | Awaitable[None]: |
There was a problem hiding this comment.
| def remove_worker( | |
| self, scheduler: Scheduler, worker: str | |
| self, scheduler: Scheduler, worker: str, *, stimulus_id: str | |
| ) -> None | Awaitable[None]: | |
| def remove_worker( | |
| self, scheduler: Scheduler, worker: str, stimulus_id: str, **kwargs | |
| ) -> None | Awaitable[None]: |
I suggest to not force the keyword and allow kwargs for future compat reasons, see #7974 (comment)
There was a problem hiding this comment.
Forcing the keyword while adding **kwargs would make a method with the signature MySchedulerPlugin.remove_worker(self, scheduler, worker, **kwargs) fully forward-compatible, so I'd suggest sticking with it unless we also want to require *args in the signature.
Makes sense, I wasn't sure if the purpose of I'll adjust this accordingly. |
crusaderky
left a comment
There was a problem hiding this comment.
Minor tweak on deprecation
Co-authored-by: crusaderky <crusaderky@gmail.com>
Co-authored-by: crusaderky <crusaderky@gmail.com>
|
@crusaderky: All feedback has been addressed and a test added for |
Addresses #7973 by implementing the bare minimum to support #7970
pre-commit run --all-files