-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Service not sending SIGINT properly to java #95
Comments
Closing this as we're moving to a different wrapper |
@treaz I'll reopen the issue and investigate what happens when I have some time. |
I have just encountered this very same issue using winsw 1.17 on Windows Server 2012 R2 Data Center. Here is the relevant wrapper log excerpt. 15-05-21 00:31:37 - Starting java -Xmx512m -Xms64m "-XX:OnOutOfMemoryError=taskkill /F /PID %p" "-Dorg.apache.el.parser.SKIP_IDENTIFIER_CHECK=true" "-Dlog4jdbc.debug.stack.prefix=com.tvrc.as" "-Dlog4jdbc.dump.sql.addsemicolon=true" "-Dlog4jdbc.sqltiming.warn.threshold=5000" "-Ddeploy.mode=prod" "-XX:+HeapDumpOnOutOfMemoryError" "-XX:MaxPermSize=128m" "-Dorg.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER=true" "-Dorg.apache.jasper.compiler.disablejsr199=true" "-Djava.net.preferIPv4Stack=true" "-Djetty.base=jetty/base/" "-Djetty.home=jetty/home/" -jar jetty/home/start.jar I also happen to run this service from the same configuration file on Windows 7 and Server 2008 R2 and I do not encounter this issue. The "Found child process" lines do not appear in the log and the graceful shutdown is successful. |
I can confirm I've got the same problem on Windows 8: |
I have found a workaround for this issue (tested in Windows Server 2012 R2 Standard) New Output 2015-08-11 14:25:38 - Starting java -Xmx512m -Xms64m "-XX:OnOutOfMemoryError=taskkill /F /PID %p" "-Dorg.apache.el.parser.SKIP_IDENTIFIER_CHECK=true" "-Dlog4jdbc.debug.stack.prefix=com.tvrc.as" "-Dlog4jdbc.dump.sql.addsemicolon=true" "-Dlog4jdbc.sqltiming.warn.threshold=5000" "-Ddeploy.mode=prod" "-XX:+HeapDumpOnOutOfMemoryError" "-XX:MaxPermSize=128m" "-Dorg.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER=true" "-Dorg.apache.jasper.compiler.disablejsr199=true" "-Djava.net.preferIPv4Stack=true" "-Djetty.base=jetty/base/" "-Djetty.home=jetty/home/" -jar jetty/home/start.jar |
Same issue here. My service wrapper runs a batch file (created by the gradle application plugin). Unfortunately, Windows doesn't have the equivalent of Using
I guess this is relying on the java process receiving the SIGINT via propagation from the parent process. Maybe conhost and cmd need special handling? i.e. ignore them, kill other process first (in this case java), then kill conhost and cmd only if necessary. |
Maybe it was an issue with wait time handling, which has been fixed in #135 . |
@rocketraman @treaz @rsargant I would appreciate if somebody retests and provides results |
@oleg-nenashev I can't test anymore since I switched companies and no longer work on windows |
@treaz thanks for the response anyway! Generally I do not work on Windows as well :( |
Same for me :(
…On Wed, Jan 11, 2017 at 1:25 PM, Oleg Nenashev ***@***.***> wrote:
@treaz <https://github.com/treaz> thanks for the response anyway!
Generally I do not work on Windows as well :(
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#95 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AMCffTq4x8mC7LEAJj8LmoYu_SAil3i2ks5rRNhlgaJpZM4EHHmB>
.
--
Alexey
|
@oleg-nenashev Sorry I'm not in a position to test this any more either :-( |
Just to join the party, I also do not use Windows as a main DEV system. And no Windows in production... Do not regret it much. I think it makes sense to close this bug for now. If it still exists, somebody can reopen this one or create a new one |
@oleg-nenashev I have tested the latest build on Windows 10, however I'm seeing the same warnings in the wrapper log and application event log. |
…a TargetPlatformVersion (#188) * Fixes #95 - Service not sending SIGINT properly to java Detach from console process after sending SIGINT to java. Note: we still need <stopparentprocessfirst> to be set to true, so the parent (java) process is shut down first. Moved exception handling to GetChildPids. StopProcessAndChildren now gets a fresh list of childPids after stopping a parent process, as that may have caused some child processes to terminate. * Fixes #181 - V2 : WinSW.NET2.exe not working Latest version of ILMerge targets .NET4 by default when merging assemblies; specify target platform version for the .NET2 executable. * Revert "Fixes #95 - Service not sending SIGINT properly to java" This reverts commit dc42c73.
* Fixes #95 - Service not sending SIGINT properly to java Detach from console process after sending SIGINT to java. Note: we still need <stopparentprocessfirst> to be set to true, so the parent (java) process is shut down first. Moved exception handling to GetChildPids. StopProcessAndChildren now gets a fresh list of childPids after stopping a parent process, as that may have caused some child processes to terminate. * Fixes #181 - V2 : WinSW.NET2.exe not working Latest version of ILMerge targets .NET4 by default when merging assemblies; specify target platform version for the .NET2 executable. * Fixes #95 - Service not sending SIGINT properly to java Error-checking for console detach, spaces indentation. #181 fix moved to separate branch. Revert "Fixes #181 - V2 : WinSW.NET2.exe not working" This reverts commit a089755.
This update includes a fix to improve termination of child processes. See winsw/winsw#95 and winsw/winsw#186
With Winsw version Not sure why it's different for Java versus other application. For example I also wrap I'm using Note for others : do not test with |
I faced the same issue however I fixed the problem by running this following command netstat -abno in "cmd" and found the same port number 8080 was listen by Tomcat. So, stopped tomcat in Taskmanager and restarted the below java file with relevant parameters. " java -Xrs -Xmx256m -Dhudson.lifecycle=hudson.lifecycle.WindowsServiceLifecycle -jar "C:\Program Files (x86)\Jenkins\jenkins.war" --httpPort=8080 --webroot="C:\Program Files (x86)\Jenkins\war and it's is working fine. |
As far as I can see, people prefer to comment on existing closed issues. |
Closing this and all related issues as fixed. |
I have a "Hello world" class (https://gist.github.com/treaz/19c8fb4a90e1cb4b9448) running as a service powered by winsw 1.17.
Stopping the service (from windows) does not work as expected (graceful shutdown).
I see the following in the logs:
I was expecting this to work in 1.17 (according to this #41)
The text was updated successfully, but these errors were encountered: