Fix checkpoint crash for actor creation task. (#4327)

* Fix checkpoint crash for actor creation task.

* Lint

* Move test to test_actor.py

* Revert unused code in test_failure.py

* Refine test according to Raul's suggestion.
This commit is contained in:
Yuhong Guo
2019-03-14 23:42:57 +08:00
committed by GitHub
parent 2f37cd7e27
commit becffc6cef
4 changed files with 57 additions and 15 deletions
+4 -2
View File
@@ -783,8 +783,10 @@ class FunctionActorManager(object):
method_returns = method(actor, *args)
except Exception as e:
# Save the checkpoint before allowing the method exception
# to be thrown.
if isinstance(actor, ray.actor.Checkpointable):
# to be thrown, but don't save the checkpoint for actor
# creation task.
if (isinstance(actor, ray.actor.Checkpointable)
and self._worker.actor_task_counter != 1):
self._save_and_log_checkpoint(actor)
raise e
else: