c5f3b12f04
When the nix daemon starts up, first check (using sd_listen_fds) whether we have been systemd socket-activated. If so, instead of passing the nix daemon socket path to grpc, start a manual accept(2) loop, passing the client file descriptors to grpc via AddInsecureChannelFromFd. There's an open grpc issue at https://github.com/grpc/grpc/issues/19133 for building support into grpc to do this automatically, but as of right now this appears to be the only way to make this happen. Making this happen, by the way, was a bit of a journey - at one point I attempted to ServerBuilder's experimental AddExternalConnectionAcceptor API, and that didn't work either - it appears that the final missing piece to getting this working was explicitly fcntl(2)ing the client file descriptors to set O_NONBLOCK before passing them into gRPC. With that set, this all works inside of the test vm. Fixes: b/56 Change-Id: I5d2ab2b5b02eb570249b30a9674e115c61b0ab0e Reviewed-on: https://cl.tvl.fyi/c/depot/+/1882 Reviewed-by: kanepyork <rikingcoding@gmail.com> Reviewed-by: tazjin <mail@tazj.in> Tested-by: BuildkiteCI |
||
---|---|---|
.. | ||
abseil_cpp | ||
alsi | ||
apereo-cas | ||
bat_syntaxes | ||
bufbuild | ||
cgit | ||
cpp/googleapis | ||
emacs | ||
farmhash | ||
ffmpeg | ||
gerrit | ||
gerrit_plugins | ||
git | ||
git-bug | ||
gitignoreSource | ||
glog | ||
gopkgs | ||
grpc | ||
gtest | ||
haskell-language-server | ||
haskell_overlay | ||
immer | ||
kernelPatches/trx40_usb_audio | ||
lieer | ||
lisp | ||
loxy | ||
naersk | ||
nix | ||
nixery | ||
notmuch | ||
nsfv | ||
openldap | ||
protobuf | ||
python/broadlink | ||
rapidcheck | ||
rr | ||
smtprelay | ||
terraform-gcp | ||
default.nix | ||
README.md |
Third-Party Code
Code under this folder is one of the following:
-
Externally developed dependencies which have been imported ("vendored") into this repository. These dependencies come with their own licenses and whatever else.
-
Code that is developed inside of this repository, but released to an external repository via Copybara.