[FIXED JENKINS-41755] background task execution#31
Conversation
|
Live from FOSDEM Hackathon waiting for some @jglick love |
|
Probably reasonable, but I am not going to touch it until #21 is merged. |
|
PR works as expected, though it would be useful to be able to read the stdout & stderr from the process, despite it being in the background. In my specific case, I would use this to check why an Android emulator process failed to launch (it writes errors to stderr (and stdout…)). |
jglick
left a comment
There was a problem hiding this comment.
it would be useful to be able to read the stdout & stderr from the process, despite it being in the background
You could just redirect stdio to some predefined file and read it when desired.
Do we actually need this feature? You can already write something like:
node {
sh 'emulator & echo $! > .pid'
try {
// whatever
} finally {
sh '[ -f .pid ] && kill `cat .pid`'
}
}(Or possibly something simpler, if the tool provides a standardized ID for running instances, such as vncserver does, or a Docker container ID as used by docker-workflow in its withRun utility. Also for production code use pwd tmp: true for a PID file location.)
| * @author Kohsuke Kawaguchi | ||
| */ | ||
| public class BackgroundTask implements Serializable { | ||
| private final DurableTaskStep.Execution execution; |
|
Is it possible this might assist in the issue at https://issues.jenkins-ci.org/browse/JENKINS-42048 ? |
|
No. |
|
I think this can be closed, WDYT @dwnusbaum ? |
Please see JENKINS-41755 for the context.