Side channel for Worker Master to send real job return codes to Controller
commitc55caf966f15a6d50d2680034490f2772ef2ab99
authorAlexander Chow <achow@fb.com>
Fri, 13 Apr 2018 21:26:53 +0000 (13 14:26 -0700)
committerHhvm Bot <hhvm-bot@users.noreply.github.com>
Fri, 13 Apr 2018 21:30:35 +0000 (13 14:30 -0700)
tree127892c05b9614017d867bb89e23e223e9205f3f
parent505b87a05a59f7df252290c1e8d2b5c67bf5c487
Side channel for Worker Master to send real job return codes to Controller

Summary:
For non-zero WEXITED returns, the Controller can observe those return
codes by just waitpid'ing on the Worker Master. This works because
the Worker Master just exits with the same code as its forked slave.

But WSIGNALED Worker Slave information is lost, as the Worker Master
just exits with code 2 (it has no way to exit with WSIGNALED). The
Worker Master just "exit 2" and the Controller will see the exit code
as 2.

This diff adds an optional side channel. Whenever the Worker Slave
exits with non-zero exit code, the real Unix.process_status will be
sent over that side channel. The Controller reads the side channel
(if it exists) to use that real process_status, instead of the
compressed one.

Reviewed By: dabek

Differential Revision: D7531163

fbshipit-source-id: f9873f8110d9944869ed1bff3d56518ee9dd1365
hphp/hack/src/heap/sharedMem.ml
hphp/hack/src/procs/worker.ml
hphp/hack/src/procs/worker.mli
hphp/hack/src/procs/workerController.ml
hphp/hack/src/procs/workerController.mli
hphp/hack/src/server/serverUtils.ml
hphp/hack/test/procs/procs_unit_test.ml