You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With the current impl, it's not possible to handle signals like SIGINT (KeyboardInterrupt) because join() calls self.lock.wait() with no timeout -- the signal is caught and queued for handling but the main thread is never given a chance to respond (waiting for compactor thread to notify()).
Adding a timeout periodically gives the main thread a chance to respond.
Workaround:
classSchedulerDriver(scheduler.PesosSchedulerDriver):
@scheduler.PesosSchedulerDriver.locked.__func__defjoin(self):
ifself.statusisnotmesos_pb2.DRIVER_RUNNING:
returnself.statuswhileself.statusismesos_pb2.DRIVER_RUNNING:
self.lock.wait(1)
scheduler.log.info(
"Scheduler driver finished with status %d",
self.status,
)
assertself.statusin (
mesos_pb2.DRIVER_ABORTED,
mesos_pb2.DRIVER_STOPPED,
)
returnself.status
The text was updated successfully, but these errors were encountered:
Good point, we should get that fixed. Taken from a framework we're using pesos with.. we're not using the join() method.
# Kick off the pesos scheduler and watch the magic happenthread=threading.Thread(target=driver.run)
thread.setDaemon(True)
thread.start()
# Wait here until the tasks are donewhilethread.isAlive():
time.sleep(0.5)
run() calls join() internally, but what you have also allows SIGINT because you are in the main thread, and you passed a "timeout" to sleep() -- the interpreter will get a chance to raise KeyboardError.
Your pesos thread will not shutdown cleanly though (marked daemon and never called stop())... not necessarily a problem, but something to keep in mind if you perform any state/syncing activities.
Your pesos thread will not shutdown cleanly though (marked daemon and never called stop())... not necessarily a problem, but something to keep in mind if you perform any state/syncing activities.
With the current impl, it's not possible to handle signals like
SIGINT
(KeyboardInterrupt) becausejoin()
callsself.lock.wait()
with no timeout -- the signal is caught and queued for handling but the main thread is never given a chance to respond (waiting for compactor thread tonotify()
).Adding a timeout periodically gives the main thread a chance to respond.
Workaround:
The text was updated successfully, but these errors were encountered: