Propagate backend error to worker (#4039)

This commit is contained in:
Hao Chen
2019-02-16 11:39:15 +08:00
committed by GitHub
parent 4be3d0c5d3
commit de17443dc2
21 changed files with 635 additions and 258 deletions
@@ -0,0 +1,16 @@
package org.ray.api.exception;
/**
* Indicates that the actor died unexpectedly before finishing a task.
*
* This exception could happen either because the actor process dies while executing a task, or
* because a task is submitted to a dead actor.
*/
public class RayActorException extends RayException {
public static final RayActorException INSTANCE = new RayActorException();
private RayActorException() {
super("The actor died unexpectedly before finishing this task.");
}
}
@@ -0,0 +1,15 @@
package org.ray.api.exception;
/**
* Indicates that a task threw an exception during execution.
*
* If a task throws an exception during execution, a RayTaskException is stored in the object store
* as the task's output. Then when the object is retrieved from the object store, this exception
* will be thrown and propagate the error message.
*/
public class RayTaskException extends RayException {
public RayTaskException(String message, Throwable cause) {
super(message, cause);
}
}
@@ -0,0 +1,13 @@
package org.ray.api.exception;
/**
* Indicates that the worker died unexpectedly while executing a task.
*/
public class RayWorkerException extends RayException {
public static final RayWorkerException INSTANCE = new RayWorkerException();
private RayWorkerException() {
super("The worker died unexpectedly while executing this task.");
}
}
@@ -0,0 +1,23 @@
package org.ray.api.exception;
import org.ray.api.id.UniqueId;
/**
* Indicates that an object is lost (either evicted or explicitly deleted) and cannot be
* reconstructed.
*
* Note, this exception only happens for actor objects. If actor's current state is after object's
* creating task, the actor cannot re-run the task to reconstruct the object.
*/
public class UnreconstructableException extends RayException {
public final UniqueId objectId;
public UnreconstructableException(UniqueId objectId) {
super(String.format(
"Object %s is lost (either evicted or explicitly deleted) and cannot be reconstructed.",
objectId));
this.objectId = objectId;
}
}