-
Notifications
You must be signed in to change notification settings - Fork 130
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
Revert #544 so that RealJenkinsRule
shuts down cleanly on Windows
#559
Conversation
Hmm the CI build does fail on Windows but not on Linux. @jglick was #544 necessary to fix an issue in some scenario, or was it just a simplification that could be reverted? As far as I can tell, that PR causes |
It could be reverted I think, but I would like to know why stopping the process does not cause terminators to run—if true, that certainly sounds like a bug? |
Discussion in JDK-4485742 and linked tickets indicates that EDIT: Also, as far as I can tell, |
Also JDK-8056139. Hmm, that is unfortunate. We could fully revert #544, or continue to send SIGTERM on Linux and just use the special |
Is there any reason to prefer |
Merely to avoid a gratuitous use of a different code path than what would often be used in a realistic context. I agree that having two modes is more confusing that it would be worth, so reverting #544 would be the simplest fix. Feel free to file that (it sounds like you already have some downstream work which would verify the effectiveness). |
RealJenkinsRule
shuts down cleanly on Windows
Ok, I pushed the revert to this PR.
I think the updates to |
You mean, when run on Windows. |
Yes, but the CI build here does test against Windows. |
Based on CI build failures in jenkinsci/workflow-cps-plugin#669 (see for example this test output), I am suspicious that beyond the lack of shutdown-related log messages on older versions of Jenkins, #544 might not shut down Jenkins cleanly on Windows, in particular I think
Jenkins.cleanUp
might not run and terminators may be skipped.This PR injects an
ItemListener
dynamically into Jenkins usingExtensionList.add
that writes a file inonBeforeShutdown
, which is called byJenkins.cleanUp
, and after the restart we check for the existence of this file. Maybe there is something else we can already observe without needing this, but withoutLoggerRule
I couldn't think of anything obvious.RealJenkinsRuleTest.restart
passes for me locally on MacOS with this PR.EDIT: The tests confirmed my suspicions, so this PR now reverts #544 so that
RealJenkinsRule
shuts down cleanly on Windows.