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
merged 1 commit into from Jan 30, 2013

Conversation

Projects
None yet
2 participants
Contributor

jeffbski commented Mar 30, 2011

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

@jeffbski jeffbski add warbler.skip_system_exit system property which if defined causes …
…JarMain to not use System.exit in the non-error flow. This fixes issue with using a service wrapper like procrun
553cda7
Owner

BanzaiMan commented Jan 30, 2013

@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

jeffbski commented Jan 30, 2013

@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 BanzaiMan added a commit that referenced this pull request Jan 30, 2013

@BanzaiMan BanzaiMan Merge pull request #22 from jeffbski/master
added system property to allow JarMain to not use System.exit in normal flow, this was causing problem when using a service wrapper
58ecd07

@BanzaiMan BanzaiMan merged commit 58ecd07 into jruby:master Jan 30, 2013

Owner

BanzaiMan commented Jan 30, 2013

OK. I'll see what I can do with regards to documentation. Again, thanks for your help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment