-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
110 - Don't stop all tasks when experiencing unexpected worker deaths #134
110 - Don't stop all tasks when experiencing unexpected worker deaths #134
Conversation
mpire/async_result.py
Outdated
MAIN = 1 | ||
INIT = 2 | ||
MAP = 3 | ||
EXIT = 4 | ||
APPLY = 5 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of explicitly setting enum values, you could also use enum.auto()
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, that's nice. TIL
def __init__( | ||
self, | ||
cache: Dict, | ||
callback: Optional[Callable], | ||
error_callback: Optional[Callable], | ||
job_id: Optional[int] = None, | ||
delete_from_cache: bool = True, | ||
timeout: Optional[float] = None, | ||
) -> None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You've started applying black?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I'm applying it to some files here and there. Will do a full black conversion later.
Also planning on introducing the other precommit checks, toml file etc. But that will take some time
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, I can't honestly say the changes it made in this PR improved it. I found it nicer to read before. I think it'll take some fancier automation to replace your sense of code style ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haha, thnx :D Yeah, I'm also not in agreement with all the choices black makes, but it's so much easier to simply hit the format code shortcut in the editor and be done with it
In the case of an unexpected worker death (e.g., OOM errors) and the worker was working on an apply task, the worker will now be restarted and the other workers will continue their work. The task that caused the death will be set to failed
Fixes #110