Make sure idle jobs only run if server is really idle
commit51ad44b2c96a4ee560ce3c03153e16a544c1f2ae
authorJez Ng <jezng@fb.com>
Sat, 22 Aug 2015 00:39:33 +0000 (21 17:39 -0700)
committerhhvm-bot <hhvm-bot@fb.com>
Sat, 22 Aug 2015 01:00:48 +0000 (21 18:00 -0700)
tree9dae16ca05c4b62633bd1a9d413bffcc38372a22
parent236573b1fe696d59d3bc7920818118bfa90b3687
Make sure idle jobs only run if server is really idle

Summary: Previously, they would run between every round of rechecking, even if
there were a client still waiting (which can happen because hack build hooks
into the next rechecking phase, and because multiple hh_clients may connect in
succession. For example, Vim's `:wa` triggers that behavior.)

Logging is slow, and GC'ing (which I intend to add to the idle job list) is
even slower, so fixing this seems worthwhile.

I had to make the KILL command specially handled, because we *don't* want to
delay killing off the server just because another client has connected to the
server.

Reviewed By: @dabek

Differential Revision: D2368901
hphp/hack/src/server/serverCommand.ml
hphp/hack/src/server/serverMain.ml
hphp/hack/src/server/serverRpc.ml
hphp/hack/src/server/serverTypeCheck.ml
hphp/hack/src/server/serverTypeCheck.mli