added system property to allow JarMain to not use System.exit in normal flow, this was causing problem when using a service wrapper#22
Merged
BanzaiMan merged 1 commit intojruby:masterfrom Jan 30, 2013
Conversation
…JarMain to not use System.exit in the non-error flow. This fixes issue with using a service wrapper like procrun
Member
|
@jeffbski Sorry that no one responded to this until now. Somewhat incredibly, it appears that we can still merge this. It seems reasonable, and I'd like to merge it. Do you mind adding a test, and perhaps documentation for it? Thank you. |
Contributor
Author
|
@BanzaiMan I wish I could but all my work with that was at my last company and I don't even have a jruby environment setup currently (doing all my current work in node.js). |
BanzaiMan
added a commit
that referenced
this pull request
Jan 30, 2013
added system property to allow JarMain to not use System.exit in normal flow, this was causing problem when using a service wrapper
Member
|
OK. I'll see what I can do with regards to documentation. Again, thanks for your help. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Nick,
I was trying to use a warbled project with the Apache commons-daemon service wrapper in windows which is called procrun.
When the warbled process would exit it was calling System.exit in the normal flow and this was causing an exception for the service wrapper (pipe broken error 109). In searching for the problem, I found that it said any child process should not call System.exit.
So assuming that System.exit is needed in some situations, I added a system property called warbler.skip_system_exit which if defined cause JarMain to not call System.exit in the normal exit flow and this solves the problem for when used with procrun. Thus it could be used with or without System.exit being called depending on whether property is defined.
I did not know how to write a test for this, but I have verified that it solves the problem when I enable the switch.
I also did not build the warbler_jar.jar yet since I had issue getting dev environment setup, so we will need to do that yet for it to take effect.
Feel free to change the property name or whatever you think is best to get this into the JarMain.
Thanks,
Jeff