Skip to content

Conversation

@jrbourbeau
Copy link
Member

Closes dask/dask#7581. @bsesar would you mind trying this PR out to see if it resolves the error you were seeing?

Note that we could also acquire active_threads_lock during the heartbeat to avoid self.active_threads changing size during iteration. However since we acquire active_threads_lock during task execution and heartbeat often I opted to not acquire the lock here to avoid coupling task execution and heartbeating. Happy to acquire active_threads_lock instead if others prefer.

@fjetter
Copy link
Member

fjetter commented Apr 22, 2021

I'm not entirely sure if this is sufficient. The dict comprehension should do the same thing as the copy, shouldn't it?

We are acquiring the lock here during profiling as well, see

with self.active_threads_lock:
active_threads = self.active_threads.copy()

@jrbourbeau jrbourbeau merged commit fa5d993 into dask:main Apr 23, 2021
@jrbourbeau jrbourbeau deleted the heartbeat-fixup branch April 23, 2021 17:01
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.

RuntimeError: dictionary changed size during iteration

2 participants