Skip to content

Conversation

@kohsuke
Copy link
Member

@kohsuke kohsuke commented Feb 6, 2017

Please see JENKINS-41755 for the context.

@kohsuke
Copy link
Member Author

kohsuke commented Feb 6, 2017

Live from FOSDEM Hackathon waiting for some @jglick love

@jglick
Copy link
Member

jglick commented Feb 6, 2017

Probably reasonable, but I am not going to touch it until #21 is merged.

@orrc
Copy link
Member

orrc commented Feb 23, 2017

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…)).

Copy link
Member

@jglick jglick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Eek!

@chancez
Copy link

chancez commented Apr 5, 2017

Is it possible this might assist in the issue at https://issues.jenkins-ci.org/browse/JENKINS-42048 ?

@jglick
Copy link
Member

jglick commented Apr 25, 2017

No.

@jglick
Copy link
Member

jglick commented Jun 12, 2020

I think this can be closed, WDYT @dwnusbaum ?

@dwnusbaum dwnusbaum closed this Jun 12, 2020
@jglick jglick deleted the JENKINS-41755 branch June 12, 2020 17:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants