-
-
Notifications
You must be signed in to change notification settings - Fork 4
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
Controller breaks on SIGHUP when ready isn't explicitly called #14
Comments
So, this code has received updates to get it working I production but there are some rough edges as you have outlined. Thanks for that. Readiness handling
We need to introduce timeout handling and backoff if failures are happening repeatedly, and this state needs to be modelled via notifications upstream. An example of this is a child which fails because of a syntax error, no amount of restarting will make it work. So we need to implement a policy for restarting: try 3 times, if it fails every time, put it on ice and inform the parent. Provide a mechanism to try failed children (e.g. Interface considerationsThe The logic was to provide something like |
I'm interested in contributing timeout handling and backoff. Since you have an approach in mind, is this something you'd be able to hand off? Realistically, it would involve some knowledge transfer. But I'm actively working on some process-related things, so I do have some context. What about changing def async(**options)
spawn(**options) do |instance|
Async::Reactor.run(instance) do |task|
yield instance, task
end
end
end Yielding two arguments from |
I'm happy for you to take a stab at the backoff handling. But, it's going to be quite tricky to get right. So happy to help. You will need to check changes with falcon too. To avoid breaking existing code: def async(**options)
spawn(**options) do |instance|
Async::Reactor.run do |task|
instance.ready!
yield task
end
end
end However I'd also be okay with removing that method. |
By the way we should probably add a spec to capture the broken behaviour before fixing it to confirm it's fixed, these are tricky issues and having coverage is really helpful. |
Discussed this with @ioquatix on Slack. Reproduce with the example code from the readme:
Send
SIGHUP
to the main process. You should see something like this in terminal:"hello" is still printed because the child process is still running. Hitting
Ctrl-C
does not stop the process at this point. Stopping the process through Activity Monitor causes this error:Here's a working version:
Couple observations:
ready!
is not called.ready!
is to be called when usingcontainer.async
.The text was updated successfully, but these errors were encountered: