# \[ray\] Inconsistent documentation: atexit behavior with ray.kill(actor)

**URL:** <https://discuss.ray.io/t/ray-inconsistent-documentation-atexit-behavior-with-ray-kill-actor/188>\
**Category:** Ray Core\
**Created:** [December 10, 2020, 3:17pm UTC](https://discuss.ray.io/t/ray-inconsistent-documentation-atexit-behavior-with-ray-kill-actor/188 "2020-12-10T15:17:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![coreylowman](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/coreylowman/32/122_2.png) [@coreylowman](https://discuss.ray.io/u/coreylowman)\
**Post date:** [December 10, 2020, 3:17pm UTC](https://discuss.ray.io/t/ray-inconsistent-documentation-atexit-behavior-with-ray-kill-actor/188/1 "2020-12-10T15:17:41Z")

</div>

In the source code documentation for `ray.kill(actor)` it states:

> This will interrupt any running tasks on the actor, causing them to fail  
> immediately. **Any atexit handlers installed in the actor will still be run.**

Source: [https://github.com/ray-project/ray/blob/master/python/ray/worker.py#L1536](https://github.com/ray-project/ray/blob/master/python/ray/worker.py#L1536)

In the documentation online it states:

> This will not go through the normal Python sys.exit teardown logic, **so any exit handlers installed in the actor using atexit will not be called.**

Source: [Actors — Ray 3.0.0.dev0](https://docs.ray.io/en/master/actors.html#manual-termination-via-an-actor-handle)

Which statement is correct?

---

<div class="post-metadata">

**Author:** ![sangcho](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/sangcho/32/425_2.png) [@sangcho](https://discuss.ray.io/u/sangcho)\
**Post date:** [December 11, 2020, 5:30pm UTC](https://discuss.ray.io/t/ray-inconsistent-documentation-atexit-behavior-with-ray-kill-actor/188/2 "2020-12-11T17:30:32Z")

</div>

cc @eoakes The documentation should be correct right? I think we should fix this msg.

---

<div class="post-metadata">

**Author:** ![eoakes](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/eoakes/32/7825_2.png) [@eoakes](https://discuss.ray.io/u/eoakes)\
**Post date:** [December 11, 2020, 10:39pm UTC](https://discuss.ray.io/t/ray-inconsistent-documentation-atexit-behavior-with-ray-kill-actor/188/3 "2020-12-11T22:39:44Z")

</div>

Thanks for pointing this out! Yes, the documentation is correct here.

PR to fix the docstring:

> <https://github.com/ray-project/ray/pull/12807>
