# \[Core\] Exception in Ray Queue, probably during shutdown

**URL:** <https://discuss.ray.io/t/core-exception-in-ray-queue-probably-during-shutdown/2166>\
**Category:** Ray Core\
**Created:** [May 15, 2021, 12:33am UTC](https://discuss.ray.io/t/core-exception-in-ray-queue-probably-during-shutdown/2166 "2021-05-15T00:33:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sunray](https://avatars.discourse-cdn.com/v4/letter/s/9d8465/32.png) [@sunray](https://discuss.ray.io/u/sunray)\
**Post date:** [May 15, 2021, 12:33am UTC](https://discuss.ray.io/t/core-exception-in-ray-queue-probably-during-shutdown/2166/1 "2021-05-15T00:33:23Z")

</div>

I am using Ray 1.3.0. I have 4 actors popping msgs off a Ray Queue and one of them got exceptions as seen below in a catch-all try block. It looks like this happened during shutdown of Ray… the run processed all the files.

Maybe Ray Queue get() client should throw a RayActorError(“shutdown”) or something similar during shutdown.

Or should any RayActorError exception should be considered fatal in client code? (I’m not using a timeout.)

```
  File "/home/sunray/ws/segment/postprocess.py", line 166, in run
    g = self.work_queue.pop()
  File "/home/sunray/ws/segment/work_queue.py", line 58, in pop
    return self._queue.get()
  File "/home/sunray/miniconda3/envs/segment/lib/python3.6/site-packages/ray/util/queue.py", line 155, in get
    return ray.get(self.actor.get.remote(timeout))
  File "/home/sunray/miniconda3/envs/segment/lib/python3.6/site-packages/ray/_private/client_mode_hook.py", line 47, in wrapper
    return func(*args, **kwargs)
ray.exceptions.RayActorError: The actor died unexpectedly before finishing this task.
```

---

<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:** [May 15, 2021, 12:37am UTC](https://discuss.ray.io/t/core-exception-in-ray-queue-probably-during-shutdown/2166/2 "2021-05-15T00:37:33Z")

</div>

This error can be raised when actor is dead, and ray.get cannot obtain the result from actor method because of that. Maybe we should improve our error message + document around the exception…

---

<div class="post-metadata">

**Author:** ![sunray](https://avatars.discourse-cdn.com/v4/letter/s/9d8465/32.png) [@sunray](https://discuss.ray.io/u/sunray)\
**Post date:** [May 15, 2021, 1:00am UTC](https://discuss.ray.io/t/core-exception-in-ray-queue-probably-during-shutdown/2166/3 "2021-05-15T01:00:52Z")

</div>

Thanks for your reply.  
I think I will catch RayActorError and consider that the shutdown notice in the actor.
