Skip to content

Commit

Permalink
Remove debug code
Browse files Browse the repository at this point in the history
  • Loading branch information
gjoseph92 committed Aug 4, 2022
1 parent e131cae commit 5303f90
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions distributed/utils_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -787,23 +787,19 @@ async def disconnect(addr, timeout=3, rpc_kwargs=None):
rpc_kwargs = rpc_kwargs or {}

async def do_disconnect():
logger.info(f"Disconnecting {addr}")
async with rpc(addr, **rpc_kwargs) as w:
logger.info(f"Disconnecting {addr} - RPC connected")
# If the worker was killed hard (e.g. sigterm) during test runtime,
# we do not know at this point and may not be able to connect
with suppress(EnvironmentError, CommClosedError):
# Do not request a reply since comms will be closed by the
# worker before a reply can be made and we will always trigger
# the timeout
await w.terminate(reply=False)
logger.info(f"Disconnecting {addr} - sent terminate")

await asyncio.wait_for(do_disconnect(), timeout=timeout)


async def disconnect_all(addresses, timeout=3, rpc_kwargs=None):
logger.info(f"Disconnecting {addresses}")
await asyncio.gather(*(disconnect(addr, timeout, rpc_kwargs) for addr in addresses))


Expand Down

0 comments on commit 5303f90

Please sign in to comment.