Bamboo build hangs on script that spawns subprocess

mike obrien
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 21, 2011

Hi,

I have a bamboo build in which one of the tasks is a python script which spawns a subprocess (using subprocess.Popen) to launch a database server which needs to stay alive throughout the rest of the build while tests run.

The script completes successfully, however the build does not proceed to the next task and just hangs. My theory is that bamboo is waiting for the subprocesses to complete as well, before continuing.

Is that what's most likely happening? Is there a way to get bamboo to recognize a script as having completed, even if a subprocess that it's spawned is still running?

Thanks in advance.

2 answers

1 vote
PiotrA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 22, 2011

Can you try to redirect the output streams and use nohup, e.g.

nohup /tmp/boo.sh > foo.out 2> foo.err < /dev/null &

?

Heather Wells
Contributor
December 27, 2011

I have what I believe is the same problem. One of the tasks starts jetty, which returns the correct exit code, but then after the application starts it writes a few more lines to the console. Bamboo hangs at this point. The solution above solved the problem.

0 votes
Jay Barra September 3, 2013

Has this been solved for launching a Windows program?

I've tried this

@echo off
start cmd /c myprogram.exe > nul

But that doesn't quite seem to cut it, Bamboo keeps grabbing the sub-process that is launched and won't progress.

Guyverthree November 9, 2015

I am struggling with the same issue. I have a simulator for a driver that i want to start as the first build job but it just hangs.

Like Antonio Vega likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events