From 74a8c3d3591801eea4ad00c74b98f0043f20d4cc Mon Sep 17 00:00:00 2001 From: Griffin Smith Date: Fri, 21 Aug 2020 18:58:58 -0400 Subject: fix(tvix): Chunk the AddTextToStore request Rather than sending the entire AddTextToStore request along in a single message, send it in a stream of chunks using the same metadata-first approach we've been using for the other store gRPC requests. This fixes a bug where certain builds could send more data than the maximum gRPC request size (4194304 bytes, it would appear), resulting in a RESOURCE_EXHAUSTED error. The initial chunk size, which is currently constant but should be made dynamic at some point in the future, has been chosen based on the IPC bandwidth delay product for tazjin's desktop, rounded up. Change-Id: I6f0232cdbc98653484816b39855126873fc59a03 Reviewed-on: https://cl.tvl.fyi/c/depot/+/1835 Tested-by: BuildkiteCI Reviewed-by: tazjin Reviewed-by: kanepyork --- third_party/nix/src/proto/worker.proto | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'third_party/nix/src/proto') diff --git a/third_party/nix/src/proto/worker.proto b/third_party/nix/src/proto/worker.proto index 6a80b3e32b42..b0dc32afbe5f 100644 --- a/third_party/nix/src/proto/worker.proto +++ b/third_party/nix/src/proto/worker.proto @@ -23,7 +23,7 @@ service WorkerService { rpc AddToStore(stream AddToStoreRequest) returns (StorePath); // Adds the supplied string to the store, as a text file. - rpc AddTextToStore(AddTextToStoreRequest) returns (StorePath); + rpc AddTextToStore(stream AddTextToStoreRequest) returns (StorePath); // Build the specified derivations in one of the specified build // modes, defaulting to a normal build. @@ -223,9 +223,16 @@ message AddToStoreRequest { } message AddTextToStoreRequest { - string name = 1; - string content = 2; - repeated string references = 3; + message Metadata { + string name = 1; + repeated string references = 2; + uint64 size = 3; + } + + oneof add_oneof { + Metadata meta = 4; + bytes data = 5; + } } message BuildPathsRequest { -- cgit 1.4.1