Skip to content
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

grpc: fix receiving empty messages when compression is enabled and maxReceiveMessageSize is MaxInt #7753 #7918

Open
wants to merge 34 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
b08845a
Fix test cases and update code to latest branch
vinothkumarr227 Dec 10, 2024
a02e58c
small tweaks
vinothkumarr227 Dec 11, 2024
54da70d
small tweaks
vinothkumarr227 Dec 12, 2024
4efd6fe
update code based on review feedback
vinothkumarr227 Dec 12, 2024
851d13a
fixed the changes based on review feedback
vinothkumarr227 Dec 13, 2024
26bf731
Added test cases for Handles maxReceiveMessageSize as MaxInt64
vinothkumarr227 Dec 17, 2024
3cf9054
Fixed the review changes
vinothkumarr227 Dec 18, 2024
27a68a0
Remove the casting for doesReceiveMessageOverflow
vinothkumarr227 Dec 18, 2024
3daef9b
Resolve all the issues
vinothkumarr227 Dec 18, 2024
8815cbd
Refactored code changes done
vinothkumarr227 Dec 18, 2024
5541486
test: switching to stubserver in tests instead of testservice (#7925)
pvsravani Dec 18, 2024
a21e192
cleanup: replace dial with newclient (#7920)
janardhanvissa Dec 18, 2024
09132bf
deps: update crypto dependency to resolve CVE-2024-45337 (#7956)
TomerJLevy Dec 20, 2024
5181e7b
test: Workaround slow SRV lookups in flaking test (#7957)
arjan-bal Dec 20, 2024
46faf72
envconfig: enable xDS client fallback by default (#7949)
easwars Dec 20, 2024
bd4989a
test: Add a test for decompression exceeding max receive message size…
arjan-bal Dec 23, 2024
985965a
outlierdetection: Support health listener for ejection updates (#7908)
arjan-bal Dec 23, 2024
8a0db4c
Revert "test: switching to stubserver in tests instead of testservice…
vinothkumarr227 Dec 23, 2024
cf12ace
Revert "cleanup: replace dial with newclient (#7920)"
vinothkumarr227 Dec 23, 2024
0e927fb
Revert "deps: update crypto dependency to resolve CVE-2024-45337 (#79…
vinothkumarr227 Dec 23, 2024
ee88fc0
Revert "envconfig: enable xDS client fallback by default (#7949)"
vinothkumarr227 Dec 23, 2024
4ef6aab
Revert "test: Add a test for decompression exceeding max receive mess…
vinothkumarr227 Dec 23, 2024
7ef57fd
Revert "outlierdetection: Support health listener for ejection update…
vinothkumarr227 Dec 23, 2024
20d4dc6
Revert the changes
vinothkumarr227 Dec 23, 2024
0907f9d
Revert the changes for test cases
vinothkumarr227 Dec 23, 2024
84e8a4f
Fix decompression size check and refactor based on review feedback
vinothkumarr227 Dec 23, 2024
77ea230
small tweaks
vinothkumarr227 Dec 24, 2024
6ff9321
Fixed the space formatting issues
vinothkumarr227 Dec 24, 2024
82124a4
Rename the test cases and refactor some of them
vinothkumarr227 Dec 24, 2024
4e9c665
Fix reviewed changes
vinothkumarr227 Jan 10, 2025
da82d30
small tweaks
vinothkumarr227 Jan 10, 2025
33962c2
Fixed test cases for decompress function
vinothkumarr227 Jan 10, 2025
23baa53
Fixed test cases for dock block
vinothkumarr227 Jan 10, 2025
7664e75
small tweaks
vinothkumarr227 Jan 10, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Revert "envconfig: enable xDS client fallback by default (#7949)"
This reverts commit 46faf72.
  • Loading branch information
vinothkumarr227 committed Dec 23, 2024
commit ee88fc03ecb3d55be6cf78c793f79cafd724c6a4
2 changes: 1 addition & 1 deletion internal/envconfig/envconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ var (
// XDSFallbackSupport is the env variable that controls whether support for
// xDS fallback is turned on. If this is unset or is false, only the first
// xDS server in the list of server configs will be used.
XDSFallbackSupport = boolFromEnv("GRPC_EXPERIMENTAL_XDS_FALLBACK", true)
XDSFallbackSupport = boolFromEnv("GRPC_EXPERIMENTAL_XDS_FALLBACK", false)
// NewPickFirstEnabled is set if the new pickfirst leaf policy is to be used
// instead of the exiting pickfirst implementation. This can be enabled by
// setting the environment variable "GRPC_EXPERIMENTAL_ENABLE_NEW_PICK_FIRST"
Expand Down
10 changes: 7 additions & 3 deletions internal/xds/bootstrap/bootstrap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,10 @@ func (s) TestGetConfiguration_Success(t *testing.T) {

for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
origFallbackEnv := envconfig.XDSFallbackSupport
envconfig.XDSFallbackSupport = true
defer func() { envconfig.XDSFallbackSupport = origFallbackEnv }()

testGetConfigurationWithFileNameEnv(t, test.name, false, test.wantConfig)
testGetConfigurationWithFileContentEnv(t, test.name, false, test.wantConfig)
})
Expand Down Expand Up @@ -1198,9 +1202,9 @@ func (s) TestNode_ToProto(t *testing.T) {
// Tests the case where the xDS fallback env var is set to false, and verifies
// that only the first server from the list of server configurations is used.
func (s) TestGetConfiguration_FallbackDisabled(t *testing.T) {
origFallbackEnv := envconfig.XDSFallbackSupport
envconfig.XDSFallbackSupport = false
defer func() { envconfig.XDSFallbackSupport = origFallbackEnv }()
// TODO(easwars): Default value of "GRPC_EXPERIMENTAL_XDS_FALLBACK"
// env var is currently false. When the default is changed to true,
// explicitly set it to false here.

cancel := setupBootstrapOverride(map[string]string{
"multipleXDSServers": `
Expand Down
16 changes: 16 additions & 0 deletions xds/internal/xdsclient/tests/fallback_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import (
"google.golang.org/grpc/codes"
"google.golang.org/grpc/credentials/insecure"
"google.golang.org/grpc/internal"
"google.golang.org/grpc/internal/envconfig"
"google.golang.org/grpc/internal/stubserver"
"google.golang.org/grpc/internal/testutils"
"google.golang.org/grpc/internal/testutils/xds/e2e"
Expand Down Expand Up @@ -78,6 +79,11 @@ func waitForRPCsToReachBackend(ctx context.Context, client testgrpc.TestServiceC
// to it. The test also verifies that when all requested resources are cached
// from the primary, fallback is not triggered when the connection goes down.
func (s) TestFallback_OnStartup(t *testing.T) {
// Enable fallback env var.
origFallbackEnv := envconfig.XDSFallbackSupport
envconfig.XDSFallbackSupport = true
defer func() { envconfig.XDSFallbackSupport = origFallbackEnv }()

ctx, cancel := context.WithTimeout(context.Background(), defaultFallbackTestTimeout)
defer cancel()

Expand Down Expand Up @@ -242,6 +248,11 @@ func (s) TestFallback_OnStartup(t *testing.T) {

// Tests fallback when the primary management server fails during an update.
func (s) TestFallback_MidUpdate(t *testing.T) {
// Enable fallback env var.
origFallbackEnv := envconfig.XDSFallbackSupport
envconfig.XDSFallbackSupport = true
defer func() { envconfig.XDSFallbackSupport = origFallbackEnv }()

ctx, cancel := context.WithTimeout(context.Background(), defaultFallbackTestTimeout)
defer cancel()

Expand Down Expand Up @@ -443,6 +454,11 @@ func (s) TestFallback_MidUpdate(t *testing.T) {

// Tests fallback when the primary management server fails during startup.
func (s) TestFallback_MidStartup(t *testing.T) {
// Enable fallback env var.
origFallbackEnv := envconfig.XDSFallbackSupport
envconfig.XDSFallbackSupport = true
defer func() { envconfig.XDSFallbackSupport = origFallbackEnv }()

ctx, cancel := context.WithTimeout(context.Background(), defaultFallbackTestTimeout)
defer cancel()

Expand Down