mirror of
https://github.com/wassname/ray.git
synced 2026-08-04 13:14:14 +08:00
Notify driver when a worker dies while executing a task. (#419)
* Notify driver when a worker dies while executing a task. * Fix linting. * Don't push error when local scheduler is cleaning up.
This commit is contained in:
committed by
Philipp Moritz
parent
85b373a4be
commit
fa363a5a3a
@@ -353,5 +353,26 @@ class ActorTest(unittest.TestCase):
|
||||
ray.worker.cleanup()
|
||||
|
||||
|
||||
class WorkerDeath(unittest.TestCase):
|
||||
|
||||
def testWorkerDying(self):
|
||||
ray.init(num_workers=0, driver_mode=ray.SILENT_MODE)
|
||||
|
||||
# Define a remote function that will kill the worker that runs it.
|
||||
@ray.remote
|
||||
def f():
|
||||
eval("exit()")
|
||||
|
||||
f.remote()
|
||||
|
||||
wait_for_errors(b"worker_died", 1)
|
||||
|
||||
self.assertEqual(len(ray.error_info()), 1)
|
||||
self.assertIn("A worker died or was killed while executing a task.",
|
||||
ray.error_info()[0][b"message"].decode("ascii"))
|
||||
|
||||
ray.worker.cleanup()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main(verbosity=2)
|
||||
|
||||
Reference in New Issue
Block a user