Skip to content

api/server/router/grpc: NewRouter: set correct MaxRecvMsgSize, MaxSendMsgSize#48242

Merged
thaJeztah merged 1 commit intomoby:masterfrom
thaJeztah:buildkit_fix_grpc_control_api_sizes
Jul 26, 2024
Merged

api/server/router/grpc: NewRouter: set correct MaxRecvMsgSize, MaxSendMsgSize#48242
thaJeztah merged 1 commit intomoby:masterfrom
thaJeztah:buildkit_fix_grpc_control_api_sizes

Conversation

@thaJeztah
Copy link
Member

api/server/router/grpc: NewRouter: set correct MaxRecvMsgSize, MaxSendMsgSize

buildkit@29b4b1a537 applied changes to buildkitd to set the correct defaults, which should be 16MB, but used the library defaults. Without that change, builds using large Dockerfiles would fail with a ResourceExhausted error;

=> [internal] load build definition from Dockerfile
 => => transferring dockerfile: 896.44kB
ERROR: failed to receive status: rpc error: code = ResourceExhausted desc = grpc: received message larger than max (44865299 vs. 16777216)

However those changes were applied to the buildkitd code, which is the daemon when running BuildKit standalone (or in a container through the container driver). When running a build with the BuildKit builder compiled into the Docker Engine, that code is not used, so the BuildKit changes did not fix the issue.

This patch applies the same changes as were made in buildkit@29b4b1a537 to the gRPC endpoint provided by the dockerd daemon.

- What I did

- How I did it

- How to verify it

- Description for the changelog

Fix a regression that could result in a `ResourceExhausted desc = grpc: received message larger than max` error when building from a large Dockerfile

- A picture of a cute animal (not mandatory but encouraged)

…dMsgSize

[buildkit@29b4b1a537][1] applied changes to `buildkitd` to set the correct
defaults, which should be 16MB, but used the library defaults. Without that
change, builds using large Dockerfiles would fail with a `ResourceExhausted`
error;

    => [internal] load build definition from Dockerfile
     => => transferring dockerfile: 896.44kB
    ERROR: failed to receive status: rpc error: code = ResourceExhausted desc = grpc: received message larger than max (44865299 vs. 16777216)

However those changes were applied to the `buildkitd` code, which is the
daemon when running BuildKit standalone (or in a container through the
`container` driver). When running a build with the BuildKit builder compiled
into the Docker Engine, that code is not used, so the BuildKit changes did
not fix the issue.

This patch applies the same changes as were made in [buildkit@29b4b1a537][1]
to the gRPC endpoint provided by the dockerd daemon.

[1]: moby/buildkit@29b4b1a

Signed-off-by: Sebastiaan van Stijn <[email protected]>
@thaJeztah
Copy link
Member Author

thaJeztah commented Jul 26, 2024

Should we have an integration-test added in the buildkit tests? Or any good suggestions for a test to be added to integration/build/ ?

I guess I could try generating a 16MB Dockerfile (FROM scratch repeated a gazillion times, or a large number of # comment lines)

@thaJeztah thaJeztah self-assigned this Jul 26, 2024
@thaJeztah
Copy link
Member Author

I'll bring this one in, but will have a look at a regression test in a follow-up

@tonistiigi
Copy link
Member

The error message does say that the limit is already 16MB (It probably comes from a different API).

@thaJeztah
Copy link
Member Author

Oh 🙈 you're right! Hmm 🤔 any ideas what else changed then that makes build fail? (as reportedly older versions didn't have this issue)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

4 participants