Script Builder Doesn't Kill Child Processes
Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.
Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Summary
When using the script builder, stopping a build abruptly leaves orphan processes
the script builder calls a bash shell script which in turn calls ant. At some point during the build Ant will fork another Java process. Three force stopping attempts at that point will stop the build but will do nothing to ant and the other java process.
Diagnosis
When Bamboo runs a script task, it only keeps track of that main script process. Any children processes that are a result of that initial script task are not controlled by Bamboo and need to be accounted for by the System Administrator. Attempting to stop the build will instruct Bamboo to interrupt only the primary shell process and will not consider any of the script's children processes.
Resolution
Manually log to the Agent and force-kill the child processes.