-
Notifications
You must be signed in to change notification settings - Fork 8
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
Catch failure to open Worker and write out port #85
base: main
Are you sure you want to change the base?
Conversation
Base.kill(proc, Base.SIGTERM) | ||
close(err.in) | ||
err_t = Threads.@spawn read(err, String) | ||
err_output = fetch(err_t) |
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.
Why not just err_output = read(err, String)
? Can you add a comment?
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.
Good question, I think this was an artifact of me moving things around. It doesn't make sense this way anymore.
Thanks! Sorry for the delay, I took a small break :) My hesitation is what happens when the worker writes to If |
Ah there is #82 about this |
Before this PR
After this PR
It looks like both implementations are incorrect/undesirable, see #82. Let's implement this PR together with fixing #82. |
I wonder how to do that, first capture a process's stdout to a buffer (to read the port on stdout and launch error on stderr), and the switching to redirecting it to stdout). EDIT: looks like Distributed does it with |
We encountered a failure on CI where starting a Malt worker resulted in an obscure error. Something like:
Turns out when a worker crashes before a port is written back, stdout is read back as
""
so you get an error when parsing that as the port number. But the underlying reason is not visible.I tried here to read from stderr to report back what happened if reading the port fails. I didn't know off the top of my head how to do this more elegantly. I'm also not sure if
proc
could stall if the worker manages to start up correctly but then writes stuff there over time but nobody reads the pipe.With this change you get this behavior on crashes:
cc @MichaelHatherly