Skip to content

Commit d95b833

Browse files
committed
KeyboardInterrupt handling in scheduler.wait
1 parent c1836fe commit d95b833

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

satyr/scheduler.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,11 @@ def report(self):
8080

8181
def wait(self, seconds=-1):
8282
with timeout(seconds):
83-
while self.healthy and not self.is_idle():
84-
time.sleep(0.1)
83+
try:
84+
while self.healthy and not self.is_idle():
85+
time.sleep(0.1)
86+
except (KeyboardInterrupt, SystemExit):
87+
raise
8588

8689
def submit(self, task): # supports commandtask, pythontask etc.
8790
assert isinstance(task, TaskInfo)
@@ -116,6 +119,7 @@ def on_update(self, driver, status):
116119
except:
117120
self.healthy = False
118121
driver.stop()
122+
raise
119123

120124
if status.has_terminated():
121125
del self.tasks[task.id]

0 commit comments

Comments
 (0)