-
-
Notifications
You must be signed in to change notification settings - Fork 749
Description
We have a task which calls a function executing worker_client. As this function gets called few times as part of the task execution, looks like we get an error:
File "e:\anaconda\python\lib\site-packages\distributed\worker_client.py", line 46, in worker_client
secede() # have this thread secede from the thread pool
File "e:\anaconda\python\lib\site-packages\distributed\threadpoolexecutor.py", line 104, in secede
thread_state.executor._threads.remove(threading.current_thread())
KeyError: <Thread(ThreadPool worker 0, started daemon 8556)>
Added rejoin after the "with" block and then it works fine. Should the work_client rejoin or have option to rejoin for such cases. Please let me know if this should be handled in any other way.
Note - Have left separate_thread option as True as not sure if setting it to False can result in the deadlock descibed in the documentation which is why we are utilizing worker_client. We are running single worker for each core with single thread.