Conversation
This was referenced Feb 14, 2025
5228c32 to
4c173da
Compare
4c173da to
ffbd9c6
Compare
Ericson2314
commented
Feb 17, 2025
Comment on lines
-61
to
-68
| // 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); |
Member
Author
There was a problem hiding this comment.
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.
Member
Author
There was a problem hiding this comment.
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.
Ericson2314
commented
Feb 17, 2025
| } | ||
|
|
||
| auto ret = master.startCommand(std::move(command), { | ||
| "-a", "-oBatchMode=yes", "-oConnectTimeout=60", "-oTCPKeepAlive=yes" |
Member
Author
There was a problem hiding this comment.
These are moved below
Ericson2314
commented
Feb 17, 2025
Comment on lines
-46
to
-48
| if (machine->isLocalhost()) { | ||
| command.push_back("--builders"); | ||
| command.push_back(""); |
Ericson2314
commented
Feb 17, 2025
Comment on lines
-50
to
-54
| auto remoteStore = machine->storeUri.params.find("remote-store"); | ||
| if (remoteStore != machine->storeUri.params.end()) { | ||
| command.push_back("--store"); | ||
| command.push_back(shellEscape(remoteStore->second)); | ||
| } |
Member
Author
There was a problem hiding this comment.
This is handled by Nix.
In NixOS/nix#10748 it is extended with everything we need.
ffbd9c6 to
4a4a0f9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In NixOS/nix#10748 it is extended with everything we need.
We are no longer explicit about reusing the same connection. However:
Nix's
poolmechanism 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.