Skip to content

Remove dead stealing code#3619

Merged
mrocklin merged 1 commit intodask:masterfrom
fjetter:maint/remove_dead_stealing_code
Mar 24, 2020
Merged

Remove dead stealing code#3619
mrocklin merged 1 commit intodask:masterfrom
fjetter:maint/remove_dead_stealing_code

Conversation

@fjetter
Copy link
Copy Markdown
Member

@fjetter fjetter commented Mar 23, 2020

This code piece seems to be unreachable since ts.processing_on to be None is only possible for tasks with a different state than processing but tasks with a different state should not be stealable. The dict stealable_unknown_durations should therefore never be populated.

Tracing back the git history I found the following commit

8404684

which refactored the stealing code to use the taskprefix containers. There, the logic for the dict population changed semantically from catching a key error to checking for the existence of the worker state object. I would argue that my initial argument about the unreachability still holds.

before this, we can only see one commit which factors the work steal code out into an extension. Unfortunately, this commit also seemed to rewrite a huge piece of the logic which is why there is no 1:1 mapping available. Browsing the original scheduler based work stealing code, we can find a variable stealable_unknown_durations but it wasn't used anywhere
https://github.com/dask/distributed/blob/e866e11936cc5c2e5bb5af48a529c93236043a71/distributed/scheduler.py

ref #3591

@mrocklin
Copy link
Copy Markdown
Member

Hrm, I'm surprised by this, but not incredibly so. Tests pass and this reduces complexity, so I'm happy to merge. If this ends up having negative effects can I depend on you to fix this @fjetter ?

@fjetter fjetter force-pushed the maint/remove_dead_stealing_code branch from bc0ff5b to 520b258 Compare March 24, 2020 06:27
@fjetter
Copy link
Copy Markdown
Member Author

fjetter commented Mar 24, 2020

The good thing about this change is that if it goes south we should see it as an AttributeError: 'NoneType' object has no attribute 'processing' exception since for this sections to have any effect the code first needs to pass the ws is None guard. It should not show up as some weird, hard to track down performance degradation and I'm fairly confident that we should be able to track such an issue down easily to this change, i.e. if that's the case you may ping me and I'll take care of it :)

@mrocklin mrocklin merged commit 0f834e7 into dask:master Mar 24, 2020
@mrocklin
Copy link
Copy Markdown
Member

Great. Merging in. Thanks for cleaning things up @fjetter !

@fjetter fjetter deleted the maint/remove_dead_stealing_code branch March 25, 2020 07:33
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.

2 participants