Skip to content

Fix an issue where a reconnecting worker could cause an invalid transition - #5210

Merged
mrocklin merged 2 commits into
dask:mainfrom
fjetter:worker_reconnect_can_break_scheduler
Aug 17, 2021
Merged

mrocklin merged 2 commits into
dask:mainfrom
fjetter:worker_reconnect_can_break_scheduler

Conversation

@fjetter

@fjetter fjetter commented Aug 13, 2021

Copy link
Copy Markdown
Member

If a worker reconnects with a key in memory which was already released by the scheduler, this would raise an invalid transition keyerror and would break the scheduler causing yet another deadlock.

There was also a weird issue about the typename function called on an instance instead of a type here

types={k: typename(v) for k, v in self.data.items()},

would cause the type being submitted to be a str of the data object, unless it's a native object like an integer in which case it works as expected. I figured it is safer to let typename handle this situation. Very difficult to test for this particular position in the code which is why I only left another validation assert

@jrbourbeau jrbourbeau left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks @fjetter! It looks like this update is causing

distributed.core - ERROR - Exception while handling op register-worker
Traceback (most recent call last):
  File "D:\a\distributed\distributed\distributed\core.py", line 502, in handle_comm
    result = await result
  File "distributed\scheduler.py", line 4172, in add_worker
    with log_errors():
  File "distributed\scheduler.py", line 4258, in distributed.scheduler.Scheduler.add_worker
    assert isinstance(t, type)
AssertionError

in CI

@fjetter
fjetter force-pushed the worker_reconnect_can_break_scheduler branch from f7de827 to 7a78601 Compare August 16, 2021 14:18
@mrocklin

Copy link
Copy Markdown
Member

Checking in. What is the status here?

@fjetter

fjetter commented Aug 17, 2021

Copy link
Copy Markdown
Member Author

good to go from my end

@mrocklin
mrocklin merged commit 6ac1d13 into dask:main Aug 17, 2021
@fjetter
fjetter deleted the worker_reconnect_can_break_scheduler branch August 17, 2021 18:49
jacobtomlinson added a commit to jacobtomlinson/dask that referenced this pull request Aug 18, 2021
jacobtomlinson added a commit to dask/dask that referenced this pull request Aug 18, 2021
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