Skip to content

Commit

Permalink
Use default_initializer in WorkerProcesses
Browse files Browse the repository at this point in the history
This function was refactored out in Dask and still has the same
functionality. While `initialize_worker_process` does work, it does a
bit more than is needed (taking a UDF to initialize too). So just use
`default_initializer`.

Also there is no need to handle old Dask versions here since we now pin
Dask & Distributed to the exact same version. So drop the fallback code.
  • Loading branch information
jakirkham committed Jun 8, 2022
1 parent 9e4e3ab commit 15b7b60
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions distributed/nanny.py
Original file line number Diff line number Diff line change
Expand Up @@ -809,12 +809,9 @@ def _run(
try:
os.environ.update(env)
dask.config.set(config)
try:
from dask.multiprocessing import initialize_worker_process
except ImportError: # old Dask version
pass
else:
initialize_worker_process()

from dask.multiprocessing import default_initializer
default_initializer()

if silence_logs:
logger.setLevel(silence_logs)
Expand Down

0 comments on commit 15b7b60

Please sign in to comment.