File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed
Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change 1515from distributed.worker import Worker
1616
1717
18- # Close gracefully when receiving a SIGINT
19- # We use SIGINT to shut down because the scheduler and worker hang
20- # if we call sys.exit() see https://github.com/dask/distributed/issues/8644
21- if threading.current_thread() is threading.main_thread():
22- signal.signal(signal.SIGINT, lambda *_: sys.exit())
23-
24-
2518class Role(Enum):
2619 """
2720 This Enum contains the various roles processes can be.
@@ -68,6 +61,11 @@ def __init__(
6861 asynchronous: bool = False,
6962 loop: asyncio.BaseEventLoop = None,
7063 ):
64+ # Close gracefully when receiving a SIGINT
65+ # We use SIGINT to shut down because the scheduler and worker hang
66+ # if we call sys.exit() see https://github.com/dask/distributed/issues/8644
67+ if threading.current_thread() is threading.main_thread():
68+ signal.signal(signal.SIGINT, lambda *_: sys.exit())
7169 self.status = Status.created
7270 self.scheduler = scheduler
7371 self.scheduler_address = None
You can’t perform that action at this time.
0 commit comments