Skip to content
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

Conversation

sybrenjansen
Copy link
Owner

@sybrenjansen sybrenjansen commented Jul 2, 2024

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

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
harmenwassenaar
harmenwassenaar previously approved these changes Jul 2, 2024
Comment on lines 14 to 18
MAIN = 1
INIT = 2
MAP = 3
EXIT = 4
APPLY = 5
Copy link
Collaborator

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().

Copy link
Owner Author

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

Comment on lines +24 to +32
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:
Copy link
Collaborator

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?

Copy link
Owner Author

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

Copy link
Collaborator

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 ;)

Copy link
Owner Author

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

@sybrenjansen sybrenjansen merged commit fd37e7c into master Jul 3, 2024
16 of 17 checks passed
@sybrenjansen sybrenjansen deleted the 110-_unexpected_death_handler-dont-stop-all-tasks-just-the-task-that-failed branch July 3, 2024 07:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

_unexpected_death_handler don't stop all tasks just the task that failed
2 participants