File tree Expand file tree Collapse file tree 1 file changed +5
-9
lines changed
Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Original file line number Diff line number Diff line change 1515from distributed .worker import Worker
1616
1717
18- def setup_signal_handler ():
19- # Close gracefully when receiving a SIGINT
20- # We use SIGINT to shut down because the scheduler and worker hang
21- # if we call sys.exit() see https://github.com/dask/distributed/issues/8644
22- if threading .current_thread () is threading .main_thread ():
23- signal .signal (signal .SIGINT , lambda * _ : sys .exit ())
24-
25-
2618class Role (Enum ):
2719 """
2820 This Enum contains the various roles processes can be.
@@ -69,7 +61,11 @@ def __init__(
6961 asynchronous : bool = False ,
7062 loop : asyncio .BaseEventLoop = None ,
7163 ):
72- setup_signal_handler ()
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 ())
7369 self .status = Status .created
7470 self .scheduler = scheduler
7571 self .scheduler_address = None
You can’t perform that action at this time.
0 commit comments