dramatiq.errors.ActorNotFound errors in Worker are not passed through result backend
- Dominant language
- Python
- Stars
- 5.3k
- Forks
- 383
- Avg merge
- 9h 41m
- Merged PRs (30d)
- 2
Description
# Issues
I am using Dramatiq 1.1.12.
I am posting background jobs to Dramatiq workers and reading the results back using the following pseudocode:
```python
# Posting tasks
message = my_task.message(*args)
# Reading results back
for slot, message in self.tasks.items():
try:
result = message.get_result()
except ResultMissing:
continue
ready[slot] = result
```
I noticed that `message.get_result()` does not have an error condition for `dramatiq.errors.ActorNotFound`. If an actor is not found on the worker, either due to not being imported or having an old codebase, the parent process asking the result back will never detect this condition. Instead, whoever is waiting for the result is going to wait indefinitely, or until the timeout.
This can be, of course, detected in the worker logs, as you will see the exception:
```
dramatiq.errors.ActorNotFound: my_task
```
However, for the developer ergonomics, I'd like to see if it's possible easily to make `ActorNotFound` condition go through the result backend, so that whoever is waiting for the result can abort immediately.
- Would this be possible with the current architecture?
- What is the process to submit a patch to dramatiq
## Checklist
* [x] Does your title concisely summarize the problem?
* [x] Did you include a minimal, reproducible example?
* [x] What OS are you using?
* [x] What version of Dramatiq are you using?
* [x] What did you do?
* [x] What did you expect would happen?
* [x] What happened?
Contributor guide
Assessment
This issue has not been assessed yet.