Skip to content

Commit

Permalink
Fix timeout on startup
Browse files Browse the repository at this point in the history
  • Loading branch information
hendrikmakait committed May 11, 2022
1 parent 622feb5 commit 159bc09
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
4 changes: 3 additions & 1 deletion distributed/cli/dask_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -478,10 +478,12 @@ async def wait_for_signals_and_close():
wait_for_nannies_to_finish()
)

await asyncio.wait(
done, _ = await asyncio.wait(
[wait_for_signals_and_close_task, wait_for_nannies_to_finish_task],
return_when=asyncio.FIRST_COMPLETED,
)
# Re-raise exceptions from done tasks
[task.result() for task in done]

try:
asyncio.run(run())
Expand Down
9 changes: 8 additions & 1 deletion distributed/cli/tests/test_dask_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,14 @@ def dask_setup(worker):
@pytest.mark.parametrize("nanny", ["--nanny", "--no-nanny"])
def test_timeout(nanny):
worker = subprocess.run(
["dask-worker", "192.168.1.100:7777", nanny, "--death-timeout=1"],
[
"python",
"-m",
"distributed.cli.dask_worker",
"192.168.1.100:7777",
nanny,
"--death-timeout=1",
],
text=True,
encoding="utf8",
capture_output=True,
Expand Down

0 comments on commit 159bc09

Please sign in to comment.