summaryrefslogtreecommitdiff
path: root/code_coverage/empty_policy
diff options
context:
space:
mode:
authorTom Cherry <tomcherry@google.com>2019-08-30 14:12:56 -0700
committerTom Cherry <tomcherry@google.com>2019-08-30 14:20:05 -0700
commit57c6a25a79afd17d0c86b06bedc3d77137415d27 (patch)
tree58fe73c80a7dce4a9fb7110a1e11f8abfeb22717 /code_coverage/empty_policy
parentca7ddf400ff18c5b73712c4b3127aba07b270ef2 (diff)
init: Always reap processes before handling properties
There is a race that manifests like this: 1) A service dies (not processed by init yet). 2) service_manager processes death notification. 3) service_manager gets checkService and calls init to start service. 4) init gets the ctl.start / ctl.interface_start for the service but the service already appears started, so it does nothing. 5) init gets sigchld, but doesn't do anything else to restart the service We can avoid all of this if we already reap pending processes before handling properties in the main loop of init. Since reaping the services calls waitid(), there's no race even if the signalfd for sigchld hasn't triggered yet. It also won't cost us much efficiency, since it's only a single system call. Test: CF boots, init unit tests pass Change-Id: Ie24ef406055b283797b41b1821c8ebcccead4db4
Diffstat (limited to 'code_coverage/empty_policy')
0 files changed, 0 insertions, 0 deletions