Skip to content
Snippets Groups Projects
Forked from hexang-mirrors / Fuchsia OS
Loading
user avatar
David Pursell authored
Previously we were removing jobs from the tree then marking them as
dead, but since removing from the tree can trigger the parent to die,
this meant that parent jobs were dying before children.

This CL switches the order so that jobs now correctly die from the
bottom of the tree up. This means that there is a brief window after a
job dies where it still exists and could be retrieved from the job tree,
but it's OK to have a handle or operate on a dead job, most functions
will just return ZX_ERR_BAD_STATE.

The reason this only manifested as test flake is because the job killing
thread would usually be allowed to complete before zx_object_wait_many()
returned in the test thread, but every once in a while
zx_object_wait_many() would fire quickly enough to catch jobs in the bad
state.

FLK-189

Test: new DEBUG_ASSERT() fired in old code but doesn't now
Test: `while runtests -t job-test; do :; done` no longer fails
      after a few minutes (QEMU ARM)
Change-Id: I38119d401c2f6e3310882a58c3d9b52e684d3d34
ed82aca2
Name Last commit Last update