Add fake Lwt_unix module to prevent linking against the real one in hh_server
commit791e1ca73294c3b7d406caa11bda3aa655f53883
authorJulia Pitts <jupi@fb.com>
Mon, 21 Oct 2019 18:40:08 +0000 (21 11:40 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Mon, 21 Oct 2019 18:42:05 +0000 (21 11:42 -0700)
treee5de403ed7b857973e76a30b6c5cf74ed3dfa451
parent4df50d893dad8361dbde9440e400ccff73722245
Add fake Lwt_unix module to prevent linking against the real one in hh_server

Summary:
In D13197032 (fixed in D13197031), and again in D13776587 (fixed in D14099177), we accidentally linked against the Lwt_unix module in hh_server. Some internal signaling behavior in Lwt_unix causes Unix.select to fail intermittently with EINTR. Since we directly use Unix.select in a number of places, and we do not handle EINTR in most of them, this causes a number of issues, including failure to load saved states and intermittent server crashes.

It's not always easy to tell when a change will result in Lwt_unix being included in hh_server builds. Consider the most recent fix, D14099177. The actual source changes appear to be completely unrelated to Lwt_unix, and have no connection to the place where the server-crashing exception was raised (P60953570).

In order to prevent this from happening again, this diff adds a fake Lwt_unix module, to ensure a compiler error in the event that we accidentally link against Lwt_unix from hh_server again in the future.

Differential Revision: D14110546

fbshipit-source-id: 63708af969b4656e02dea0e0e302584a04d3480a
hphp/hack/src/lwt_unix.ml [new file with mode: 0644]