Skip to content

Commit

Permalink
reduce log spewing in nanny
Browse files Browse the repository at this point in the history
  • Loading branch information
gjoseph92 committed May 24, 2022
1 parent 3405583 commit 4d61b38
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
7 changes: 1 addition & 6 deletions distributed/nanny.py
Original file line number Diff line number Diff line change
Expand Up @@ -678,13 +678,11 @@ async def start(self) -> Status:
logger.exception("Nanny failed to start process", exc_info=True)
await self.process.terminate()
self.status = Status.failed
return self.status
try:
msg = await self._wait_until_connected(uid)
except Exception:
logger.exception("Failed to connect to process")
self.status = Status.failed
await self.process.terminate()
self.status = Status.failed
raise
if not msg:
return self.status
Expand Down Expand Up @@ -809,9 +807,6 @@ async def _wait_until_connected(self, uid):
continue

if "exception" in msg:
logger.error(
"Failed while trying to start worker process: %s", msg["exception"]
)
raise msg["exception"]
else:
return msg
Expand Down
2 changes: 2 additions & 0 deletions distributed/tests/test_nanny.py
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,8 @@ async def test_worker_start_exception(s):
# ^ NOTE: `Nanny.close` sets it to `closed`, then `Server.start._close_on_failure` sets it to `failed`
assert nanny.process is None
assert "Restarting worker" not in logs.getvalue()
# Avoid excessive spewing. (It's also printed once extra within the subprocess, which is okay.)
assert logs.getvalue().count("test_nanny.StartException: broken") == 1


@gen_cluster(nthreads=[])
Expand Down

0 comments on commit 4d61b38

Please sign in to comment.