Try to gracefully stop server process when monitor exits
commit30198bb88a7a8520a3b660ef7f4ba4f03f59a445
authorGabe Levi <gabe@fb.com>
Tue, 22 May 2018 14:15:53 +0000 (22 07:15 -0700)
committerHhvm Bot <hhvm-bot@users.noreply.github.com>
Tue, 22 May 2018 14:34:38 +0000 (22 07:34 -0700)
tree57bdeea82875013d54a18e21882eed868a9197b1
parent1e4be457017bacc408469d98380bfcff7fc76fcb
Try to gracefully stop server process when monitor exits

Summary:
Currently, when the monitor process dies, the server process
dies too. Unfortunately, it shuts down in a less-than-graceful way. The
server process notices that the pipe to the monitor is broken and throws
an uncaught exception.

We can do better, now that the server uses Lwt and processes each
message as soon as it comes over the pipe. When the monitor is about to
exit, it can tell the server to shut down. Then the server can do its
best to gracefully die.

Reviewed By: samwgoldman

Differential Revision: D7472609

fbshipit-source-id: 551ad3acd80e071c91f0fead5f9ab55502779aed
hphp/hack/src/utils/sys/daemon.ml