Failing child processes when tracking missing git branches

Some child processes appear to crash when continuing after an element fails to track its git branch due to a missing branch, resulting in buildstream getting stuck waiting for their completion.

See this log of the stderr of bst --on-error continue build --track base-system.bst on the booting-base-system-scratch branch of buildstream-tests: error.log

A minimal test case for my system:

project.conf:

name: test-weird-crashes

element-path: elements

elements/test.bst:

kind: manual

depends:
  - another_test.bst
  - another_test1.bst
  - another_test2.bst
  - another_test3.bst
  - another_test4.bst
  - another_test5.bst
  - another_test6.bst

sources:
- kind: git
  url: git://git.baserock.org/delta/busybox
  track: 1_2_3_1

  ref: 1231a93bd05f8999fb25560fae17e7bc1d272a4f
config:
  configure-commands:
    - echo 'Test'

elements/another_test{1..6}.bst:

kind: manual

config:
  configure-commands:
    - echo 'This is only here to be a dependency...'

Running bst --on-error continue build --track test.bst, you should see messages like these:

Unknown child process pid 3158, will report returncode 255
Unknown child process pid 3162, will report returncode 255

This seems like a very specific multithreading issue, so it is probably hard to reproduce...

Edited by Tristan Maat