Actor cancel - reason for no implementation

  • Low: It annoys or frustrates me for a moment.

Why isn’t ray.cancel supported for ray actors?
is there a real reason why it isn’t supported or is it that it wasn’t required yet?

Hi @shiranbi,

For ray actors, you can use ray.kill. Unlike task submission, which is managed by the owner of the task, actor lifetimes are managed centrally by the GCS service, so the process of deleting them is much more involved. My guess is that the APIs have different names because the behavior is not exactly the same.

Curious about the specific context where this comes up for you – there is certainly room for improvement in defining the behavior of the deletion APIs and supporting smoother interop between task cancellation and actor killing.

i don’t want to cancel an entire actor (and by that kill), i want to cancel a single remote function call to an actor
calling ray.cancel triggers a keyboard interrupt exception in the remote function call as far as I understand
I am wondering why that isn’t possible on actors remote function calls as well?

We currently don’t allow cancelling an actor task because doing so might leave the actor’s internal states in an inconsistent manner.

However, I think we could also augment the API to allow people to do it. cc @sangcho

Yeah as @rickyyx said, this can corrupt the actor state, and the state after cancellation is basically unknown. I don’t know how good idea it is to expose this API with the “use at your own risk” mode.

If you still would like to discuss, please create a feature request. We can follow up there.

1 Like