-
-
Notifications
You must be signed in to change notification settings - Fork 750
Closed
Labels
Description
Describe the issue:
I'm getting a similar error to this old issue even though rejoin is called. Based on some print statements in secede and rejoin and assuming that the order of output is the same as the order of execution, it seems it might be due to non deterministic ordering.
Relevant output:
seceded <Thread(Dask-Default-Threads-4156020-0, started daemon 140297992402688)>
rejoined <Thread(Dask-Default-Threads-4156020-0, started daemon 140297992402688)>
seceded <Thread(Dask-Default-Threads-4156020-0, started daemon 140297992402688)>
seceded <Thread(Dask-Default-Threads-4156015-0, started daemon 140222050313984)>
rejoined <Thread(Dask-Default-Threads-4156020-0, started daemon 140297992402688)>
2025-03-31 21:12:54,970 - distributed.protocol.pickle - ERROR - Failed to serialize <Thread(Dask-Default-Threads-4156020-0, started daemon 140297992402688)>.
Traceback (most recent call last):
File "/mnt/disks/data/miniforge3/envs/etl/lib/python3.11/site-packages/distributed/worker_client.py", line 71, in worker_client
secede() # have this thread secede from the thread pool
^^^^^^^^
File "/mnt/disks/data/miniforge3/envs/etl/lib/python3.11/site-packages/distributed/threadpoolexecutor.py", line 121, in secede
thread_state.executor._threads.remove(threading.current_thread())
KeyError: <Thread(Dask-Default-Threads-4156020-0, started daemon 140297992402688)>
...
rejoined <Thread(Dask-Default-Threads-4156015-0, started daemon 140222050313984)>
Minimal Complete Verifiable Example:
Although it's reproducible in my environment, coming up with a MCVE may be tricky.
Environment:
- Dask version: 2025.3.0
- Python version: 3.11.10
- Operating System: Linux Debian 5.10.197-1
- Install method (conda, pip, source): pip