-
-
Notifications
You must be signed in to change notification settings - Fork 719
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
Migrate ensure_communicating
transitions to new WorkerState event mechanism
#5896
Comments
Apparently some of these tests are not rock solid. E.g. in #6166 https://github.com/dask/distributed/runs/6101034638?check_suite_focus=true Based on the traceback, it looks like the mock.patch was not properly removed after leaving the context manager. To rule this out and see if there is something else ongoing, I removed the mocks in favour of some event/lock/subclass magic. I realise that these tests are not great and are extremely difficult to maintain. We can have a conversation about removing some of them but I would like to not have this conversation right now. I consider this new approach easier to reason about and at least slightly easier to maintain. As part of #5896 I very much hope that we can remove some, if not all of these tests and replace them with some much easier unit tests. I would like to have the conversation about removing code once we are in a position to replace them with something simpler. This is not in scope for this PR
Is cancellation of |
It's out of scope. |
The
ensure_communicating
transitions should be migrated to theWorkerState
event mechanism as outlined in #5736 (comment)Worker._gather_dep
method is broken up intoWorker._gather_remote_data
which accepts an instruction indicating what keys to fetch, the remote worker address, etc. It performs the actual communication and returns a list of events about the outcome of the remote fetch (e.g. Success, DataMissing, RemoteBusy, Error, ...)Worker(State)._handle_gather_remote_busy
that deal with the result of the fetch attemptensure_communicating
method is removed from the list ofhandle_comm
every_cycle
callbacksensure_communicating
is moved to a private method (perspectively a method of the new classWorkerState
)transition_flight_fetch
unpause
self.loop.add_callback(self.gather_dep, ...)
and replace this with the new callback methodSubtasks
Blocked by
Related work
ensure_computing
transitions to newWorkerState
event mechanism #5895The text was updated successfully, but these errors were encountered: