Add a flag to disable reconstruction for a killed actor#7346
Add a flag to disable reconstruction for a killed actor#7346raulchen merged 12 commits intoray-project:masterfrom
Conversation
|
Can one of the admins verify this patch? |
|
Test FAILed. |
|
Test FAILed. |
|
@kfstorm I'm not sure about this change actually. |
|
ps:Not related to this PR. I'don't know if it's too late to suggest renaming it to |
|
I think the best would be to have API:
|
It could be that it re-creates with initial state? Instead of reconstructed state? (I am assuming what reconstructable actor is, I am not really familiar with that.) |
|
@kfstorm I don't think we want to expose this in the python API without more discussion about the API/semantics, so maybe add the flag but don't make it public yet? |
|
Test PASSed. |
|
Test PASSed. |
| */ | ||
| public static void killActor(RayActor<?> actor) { | ||
| runtime.killActor(actor); | ||
| public static void killActor(RayActor<?> actor, boolean noReconstruction) { |
There was a problem hiding this comment.
Also move this API to RayActor?
| public static class KillerActor { | ||
|
|
||
| public void kill(RayActor<?> actor, boolean noReconstruction) { | ||
| Ray.killActor(actor, noReconstruction); |
There was a problem hiding this comment.
I've merged the new API, can you rebase and update this?
|
|
||
| worker = ray.worker.get_global_worker() | ||
| worker.core_worker.kill_actor(actor._ray_actor_id) | ||
| worker.core_worker.kill_actor(actor._ray_actor_id, False) |
There was a problem hiding this comment.
Should we expose an option to this kill method? It can default to False.
There was a problem hiding this comment.
@edoakes just saw your comment above. I think it makes more sense to add an option here and deprecate __ray_terminate__.
Because, 1) having two different APIs (kill and __ray_terminate__) is confusing to users. 2) __ray_terminate__ is also an actor method, if the actor is hanging, it won't take effect.
There was a problem hiding this comment.
I agree that having ray.kill and actor.__ray_terminate__ is confusing. They have similar effects but with different approaches. We can combine them into one API.
There was a problem hiding this comment.
Completely agree - ray.kill with a "force kill" flag seems best to me
|
Test FAILed. |
| RAY_CHECK_OK(KillActor(actor_id, /*intentional=*/true)); | ||
| RAY_CHECK_OK( | ||
| KillActor(actor_id, /*force_kill=*/true, /*no_reconstruction=*/false)); |
There was a problem hiding this comment.
@stephanie-wang Maybe the second argument should be false? Do you try to destroy the actor gracefully?
|
Test FAILed. |
|
Test FAILed. |
|
Test FAILed. |
|
Test FAILed. |
|
Can you merge master and resolve the conflicts? |
|
Test PASSed. |
Add
local_raylet_client_->Disconnect()inCoreWorker::HandleKillActorto mark the actor as dead instead of reconstructing, if theno_reconstructionflag is set to true.Currently the flag is exposed in Java only.