Bamboo build hangs on script that spawns subprocess

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

This widget could not be displayed.

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

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

?

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.

This widget could not be displayed.

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.

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.

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Thursday in United States

Local Atlassian Research Workshop opportunity on Sep. 28th

We're looking for participants for another workshop at Atlassian! We need Jira admins who have interesting custom workflows, issue views, or boards. Think you have a story to sh...

72 views 0 0
View post

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you