-
Notifications
You must be signed in to change notification settings - Fork 228
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
Zeus ignores exit status of its commands #252
Comments
I have this problem also. I run zeus from a test shell. The incorrect status codes break the shell alerting function. |
I'm having this issue as well. Zeus is returning 1 when it should return 0. |
Seems like the exit-status is generated by 'zeus/build/zeus-linux-386', which is a binary file (a go executable?). So I don't think its possible to fix this problem in the field. (without getting hands-on with go...) |
@andyl, that's right, and why I'm hoping @burke can take a look into it. That fact is one reason Spring may On Sat, Feb 16, 2013 at 5:55 PM, andyl notifications@github.com wrote:
|
Spring looks nice! Thanks for that reference. But Spring also ignores the exit status. (rails/spring#57) I prefer the zeus style of pre-loading. Come on @burke - we need your Go skills! |
For the record, @jonleightonfixed fixed that 5 days after you reported it in the Spring repo. |
I traced zeusclient.go a bit, and this appears to happen because it's getting a TERM signal. Right now, I believe this is actually a ruby issue - rubygem/lib/zeus.rb has an at_exit line that kills the client with TERM when the command terminates. My hypothesis right now is that this causes a race condition where zeusclient can't read the exit code from the socket fast enough, and ends up receiving the async signal before it can itself exit with the right exit code. Removing that at_exit line seems safe, but might be useful to have a safeguard in there to prevent the go client from hanging (though in my experience, that is the least breakage-happy part (-:). I'll read some more code and try to figure out the right way to proceed. |
@antifuchs looks like you've succeeded at fixing this! It's exiting correctly for me now, and I didn't even have to |
@turadg that's weird - I built the (patched) gem that we use at work by following these steps:
The resulting gem does work for me without crashing... to make things a bit easier (no need to install the gem), you should be able to run just the zeus binary out of the build/ dir - what error messages are you getting and what are the relevant versions of tools you're using? I'm on go1.0.3, ruby 1.9.3p362 (via rbenv). |
@antifuchs, good idea to run from
That starts Zeus but the bottom of the terminal briefly says "exit status 1" in white. Then it refreshes, to clear that but all forks stay yellow (waiting) except for boot which stays magenta (connecting). That's with ruby 1.9.3p374 (via rbenv) and same go1.0.3. Xcode 4.6 with latest command line tools. At least now the problem appears whether I'm changing the VERSION or not, which was weird. I'd like to get this the new gem into people's hands. If you build a 0.13.3.rc2 and send it to me, I'll push it. Or maybe @burke will build and push it, or grant you access to push. |
Description of Problem
When Zeus runs a command from a plan and it exits with an exit code, that is lost by the time it returns back to the shell. That's the cause of #198 and is posing problems for Zeus with Guard (a major use case).
Steps to Reproduce
zeus.json
:Observed Behavior
The shell shows 1 as the exit status code even though Ruby exited with 99. (It seems to return 1 no matter what the Ruby exit code.)
Expected Behavior
That the
zeus
shell command returns whatever Ruby'sKernel.exit
was passed.The text was updated successfully, but these errors were encountered: