From 9b3e2a6aebbb08f669c9fecdab71049ff6d4d736 Mon Sep 17 00:00:00 2001 From: Quang-Minh Nguyen Date: Thu, 26 Dec 2024 15:11:13 +0700 Subject: [PATCH] Downgrade grpc-go to v1.66.3 grpc-go v1.67.0 (https://github.com/grpc/grpc-go/releases/tag/v1.67.0) caused two major problems for Gitaly and Praefect. First, this version introduced a bug related to window header calculation. This bug makes Gitaly return ResourceExhausted errors occasionally even if the calls were successful. For more information: https://gitlab.com/gitlab-org/gitaly/-/issues/6385 Second, clients and servers will now reject TLS connections that don't support ALPN. This restriction deems Gitaly/Praefect not compatible with some certain TCP load-balancers, such as Nginx, if TLS is enabled. The problem will go away if customers place Gitaly/Prafect behind an HTTP/2 or gRPC load balancers. Unfortunately, L7 load-balancers are not compatible with Gitaly/Praefect due to the Sidechannel Protocol. Although this feature could be turned off by turning on the `GRPC_ENFORCE_ALPN_ENABLED` flag, it's annoying for our customers. For more information: https://gitlab.com/gitlab-com/request-for-help/-/issues/2127 The first bug was fixed in v1.67.1 and back-ported to v1.66.3. The second bug (or feature?) has not been addressed upstream, yet. Although we are looking forward to a long-term solution so that Sidechannel is replaced by something else such as gRPC buffer pooling (https://gitlab.com/gitlab-org/gitaly/-/issues/6560) or pure HTTP/2. It might take a while until an alternative solution lands. Thus, this commit downgrades grpc-go back to 1.66.3. This version didn't introduce the new APLN enforcement and it contains the back-port of the first bug (https://github.com/grpc/grpc-go/pull/7660 and https://github.com/grpc/grpc-go/pull/7668). --- go.mod | 7 +++++-- go.sum | 8 ++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index a2f3e77105..bf2823b149 100644 --- a/go.mod +++ b/go.mod @@ -23,7 +23,7 @@ require ( github.com/google/go-cmp v0.6.0 github.com/google/uuid v1.6.0 github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 - github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.2.0 + github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.1.0 github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 github.com/hashicorp/golang-lru/v2 v2.0.7 github.com/hashicorp/yamux v0.1.2-0.20220728231024-8f49b6f63f18 @@ -53,7 +53,10 @@ require ( golang.org/x/text v0.21.0 golang.org/x/time v0.7.0 google.golang.org/genproto/googleapis/rpc v0.0.0-20240930140551-af27646dc61f - google.golang.org/grpc v1.68.1 + // Please upgrade grpc-go with caution. Newer grpc-go versions contain some known issues: + // - https://gitlab.com/gitlab-com/request-for-help/-/issues/2127 + // - https://gitlab.com/gitlab-org/gitaly/-/issues/6385 + google.golang.org/grpc v1.66.3 google.golang.org/protobuf v1.35.2 ) diff --git a/go.sum b/go.sum index 150a5a7248..51029e3ccc 100644 --- a/go.sum +++ b/go.sum @@ -417,8 +417,8 @@ github.com/gorilla/sessions v1.2.1 h1:DHd3rPN5lE3Ts3D8rKkQ8x/0kqfeNmBAaiSi+o7Fsg github.com/gorilla/sessions v1.2.1/go.mod h1:dk2InVEVJ0sfLlnXv9EAgkf6ecYs/i80K/zI+bUmuGM= github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 h1:UH//fgunKIs4JdUbpDl1VZCDaL56wXCB/5+wF6uHfaI= github.com/grpc-ecosystem/go-grpc-middleware v1.4.0/go.mod h1:g5qyo/la0ALbONm6Vbp88Yd8NsDy6rZz+RcrMPxvld8= -github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.2.0 h1:kQ0NI7W1B3HwiN5gAYtY+XFItDPbLBwYRxAqbFTyDes= -github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.2.0/go.mod h1:zrT2dxOAjNFPRGjTUe2Xmb4q4YdUwVvQFV6xiCSf+z0= +github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.1.0 h1:pRhl55Yx1eC7BZ1N+BBWwnKaMyD8uC+34TLdndZMAKk= +github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.1.0/go.mod h1:XKMd7iuf/RGPSMJ/U4HP0zS2Z9Fh8Ps9a+6X26m/tmI= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 h1:Ovs26xHkKqVztRpIrF/92BcuyuQ/YW4NSIpoGtfXNho= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= @@ -1139,8 +1139,8 @@ google.golang.org/grpc v1.37.1/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQ google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= google.golang.org/grpc v1.39.0/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= google.golang.org/grpc v1.39.1/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= -google.golang.org/grpc v1.68.1 h1:oI5oTa11+ng8r8XMMN7jAOmWfPZWbYpCFaMUTACxkM0= -google.golang.org/grpc v1.68.1/go.mod h1:+q1XYFJjShcqn0QZHvCyeR4CXPA+llXIeUIfIe00waw= +google.golang.org/grpc v1.66.3 h1:TWlsh8Mv0QI/1sIbs1W36lqRclxrmF+eFJ4DbI0fuhA= +google.golang.org/grpc v1.66.3/go.mod h1:s3/l6xSSCURdVfAnL+TqCNMyTDAGN6+lZeVxnZR128Y= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/grpc/stats/opentelemetry v0.0.0-20240907200651-3ffb98b2c93a h1:UIpYSuWdWHSzjwcAFRLjKcPXFZVVLXGEM23W+NWqipw= google.golang.org/grpc/stats/opentelemetry v0.0.0-20240907200651-3ffb98b2c93a/go.mod h1:9i1T9n4ZinTUZGgzENMi8MDDgbGC5mqTS75JAv6xN3A= -- GitLab