question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"Set changed size during iteration" Error in Worker.put_key_in_memory()

See original GitHub issue

I am getting an error in this line: https://github.com/dask/distributed/blob/d54388c92f5cb6643180749f7d30f580609379a2/distributed/worker.py#L1970

Maybe a temporary copy of ts.dependents helps here?

Exception in callback functools.partial(<bound method IOLoop._discard_future_result of <tornado.platform.asyncio.AsyncIOMainLoop object at 0x7fa72878fb90>>, <Task finished coro=<Worker.gather_dep() done, defined at [...]/python3.7/site-packages/distributed/worker.py:2000> exception=RuntimeError('Set changed size during iteration')>)
Traceback (most recent call last):
File "[...]/python3.7/site-packages/tornado/ioloop.py", line 743, in _run_callback
  ret = callback()
File "[...]/python3.7/site-packages/tornado/ioloop.py", line 767, in _discard_future_result
  future.result()
File "[...]/python3.7/site-packages/distributed/worker.py", line 2119, in gather_dep
  self.transition(ts, "memory", value=data[d])
File "[...]/python3.7/site-packages/distributed/worker.py", line 1539, in transition
  state = func(ts, **kwargs)
File "[...]/python3.7/site-packages/distributed/worker.py", line 1605, in transition_flight_memory
  self.put_key_in_memory(ts, value)
File "[...]/python3.7/site-packages/distributed/worker.py", line 1970, in put_key_in_memory
  for dep in ts.dependents:
RuntimeError: Set changed size during iteration

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:11 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
gerrymanoimcommented, Aug 30, 2021

Thanks - will try that as soon as I can.

0reactions
jrbourbeaucommented, Aug 30, 2021

Thanks @gerrymanoim

Read more comments on GitHub >

github_iconTop Results From Across the Web

dictionary changed size during iteration" error? - Stack Overflow
This way you iterate over the original dictionary fields and on the fly can change the desired dict d . It works on...
Read more >
RuntimeError: Set changed size during iteration in Python
The Python RuntimeError: Set changed size during iteration in Python occurs when we change the size of a `set` object when iterating over...
Read more >
RuntimeError- Set changed size during iteration
RuntimeError: Set changed size during iteration A set needs to stay the same size while you iterate through it , or while you...
Read more >
RuntimeError: dictionary changed size during iteration
In very rare cases a program crashes (hard to reproduce) : * several threads work on an object tree with dict's etc. in...
Read more >
Issue 43498: "dictionary changed size during iteration" error in ...
run() File ".../components/python/python39/build/prototype/sparc/usr/lib/python3.9/concurrent/futures/process.py", line 317, in run result_item, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found