-
-
Notifications
You must be signed in to change notification settings - Fork 312
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use LegacySSHStore
#1444
Use LegacySSHStore
#1444
Conversation
5228c32
to
4c173da
Compare
4c173da
to
ffbd9c6
Compare
// XXX: determine the actual max value we can use from /proc. | ||
|
||
// FIXME: Should this be upstreamed into `startCommand` in Nix? | ||
|
||
int pipesize = 1024 * 1024; | ||
|
||
fcntl(ret->in.get(), F_SETPIPE_SZ, &pipesize); | ||
fcntl(ret->out.get(), F_SETPIPE_SZ, &pipesize); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In NixOS/nix#10765 @vcunat determind this code was wrong. However, if the address is not too large it might make the pipe larger? Something should be done upstream.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is now done below too.
See
remoteStore->connPipeSize = 1024 * 1024;
Setting a variable doesn't have any side-effects. We do that before any connection is established, however, and then that setting will be applied.
} | ||
|
||
auto ret = master.startCommand(std::move(command), { | ||
"-a", "-oBatchMode=yes", "-oConnectTimeout=60", "-oTCPKeepAlive=yes" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are moved below
if (machine->isLocalhost()) { | ||
command.push_back("--builders"); | ||
command.push_back(""); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is done below
auto remoteStore = machine->storeUri.params.find("remote-store"); | ||
if (remoteStore != machine->storeUri.params.end()) { | ||
command.push_back("--store"); | ||
command.push_back(shellEscape(remoteStore->second)); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is handled by Nix.
In NixOS/nix#10748 it is extended with everything we need.
ffbd9c6
to
4a4a0f9
Compare
In NixOS/nix#10748 it is extended with everything we need.
We are no longer explicit about reusing the same connection. However:
Nix's
pool
mechanism will not close valid connections; it always keeps them around in case they are of use laterMax connections defaults to 1, so we won't open up multiple connections.
Between these two things, we are, in fact, guaranteed to reuse the same connection from one command/query to the next.