Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign up[JENKINS-50166] Option to not to kill process on interruption #3351
Conversation
|
Generally needs feedback from @daniel-beck, I'd guess |
|
@daniel-beck gentle ping |
|
@daniel-beck could you review this PR? |
|
Still lagging behind my review queue, sorry about that. |
|
@daniel-beck gentle ping |
| } | ||
|
|
||
| /** | ||
| * @param err | ||
| * null to redirect stderr to stdout. | ||
| */ | ||
| public LocalProc(String[] cmd,String[] env,InputStream in,OutputStream out,OutputStream err,File workDir) throws IOException { | ||
| public LocalProc(String[] cmd,String[] env,InputStream in,OutputStream out,OutputStream err,File workDir, boolean dontKillWhenInterrupted) throws IOException { |
This comment has been minimized.
This comment has been minimized.
| * Indicates that the process should not be killed on interruption. | ||
| * @since TODO | ||
| */ | ||
| protected boolean dontKillWhenInterrupted; |
This comment has been minimized.
This comment has been minimized.
| * | ||
| * <p> | ||
| * Note that the process can (and should) be killed | ||
| * via {@link Proc#kill()} when custom action is done. |
This comment has been minimized.
This comment has been minimized.
daniel-beck
May 14, 2018
Member
This indicates to me that the better API design is to submit a callback to be invoked between interrupting and killing, rather than just a flag to skip it.
This comment has been minimized.
This comment has been minimized.
apetres
Jul 16, 2018
Author
Contributor
I agree. But it makes the implementation more complicated...
@oleg-nenashev could you recommend a way to pass the callback? I tried to pass hudson.remoting.Callable but I got NotSerializableExceptions.
|
@apetres do you have plans to keep working on this? |
|
Not really. Seems too complicated to implement it the proper way (submit callback over remoting) and I don't have time right to do it. |
apetres commentedMar 14, 2018
Processes created by
Launcherare always killed on interruption. This is undesired if the caller (plugin) wants to do some action before the process is killed. My solution is to add a flag toLauncherwhich prevents the killing of the created process on (build) interruption.This is a follow-up for #3293.
See JENKINS-50166.
Proposed changelog entry
Launcheron interruptionDesired reviewers
@oleg-nenashev
@daniel-beck