Skip to content

Commit e768524

Browse files
authored
fix(pubsublite): reduce pscompat BufferedByteLimit (#14234)
Reduced default BufferedByteLimit in pscompat layer to ensure compatibility with 32-bit architectures. This prevents compilation errors and potential OOM issues on memory-constrained systems (10 GB default is too high). Users requiring extremely large buffers on 64-bit systems can still override these settings manually. Note: Pub/Sub Lite has been deprecated and is scheduled to be shut down in [June 2026](https://docs.cloud.google.com/pubsub/lite/docs). Fixes #14237
1 parent 46df848 commit e768524

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

pubsublite/internal/wire/settings_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ func TestValidatePublishSettings(t *testing.T) {
3838
// These have no max bounds, check large values.
3939
settings.DelayThreshold = 24 * time.Hour
4040
settings.Timeout = 24 * time.Hour
41-
settings.BufferedByteLimit = 1e10
41+
settings.BufferedByteLimit = 1e9
4242
},
4343
wantErr: false,
4444
},
@@ -133,7 +133,7 @@ func TestValidateReceiveSettings(t *testing.T) {
133133
settings.Partitions = []int{5, 3, 9, 1, 4, 0}
134134
// These have no max bounds, check large values.
135135
settings.MaxOutstandingMessages = 100000
136-
settings.MaxOutstandingBytes = 1e10
136+
settings.MaxOutstandingBytes = 1e9
137137
settings.Timeout = 24 * time.Hour
138138
},
139139
wantErr: false,

pubsublite/pscompat/settings.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ var DefaultPublishSettings = PublishSettings{
122122
CountThreshold: 100,
123123
ByteThreshold: 1e6,
124124
Timeout: 7 * 24 * time.Hour,
125-
BufferedByteLimit: 1e10,
125+
BufferedByteLimit: 1e9,
126126
EnableIdempotence: true,
127127
}
128128

0 commit comments

Comments
 (0)