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

Allow for spawning children with the same name as terminating child #889

Open
varsill opened this issue Oct 4, 2024 · 0 comments
Open
Assignees

Comments

@varsill
Copy link
Contributor

varsill commented Oct 4, 2024

In case a child needs to be gracefully restarted (terminated and spawned with the same name once again) it is difficult to figure out when it is OK to return spec action. In case that action is returned prematurely, when the child is still terminating, it will cause crash due to duplicated children error.
The following solutions could help solve this problem:

  • adding handle_child_terminated callback in pipelines and bins so that user can return spec action in response to child termination
  • adding new child spec to the awaiting_specs and executing spec action from that awaiting_specs when children which blocked execution of given spec terminates (possibly we should also think about some configurable timeout which user could use to specify how long spec can wait in awaiting_specs)

It's important not to have two children with the same name running concurrently (we cannot spawn new child when the old one is still terminating) as it might cause some trouble with shared resources access etc.
Furthermore, we need to think whether or not we should preserve the guarantee we currently have, that in the first callback invoked after the callback where spec is returned, the newly spawned child is already available in context and can be refered, for instance, with notify_child action.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Todo
Development

No branches or pull requests

2 participants