build(deps): bump dependencies (#12871)

build(deps): bump google.golang.org/grpc and browserslist
This commit is contained in:
isha authored and GitHub committed 2026-09-02 15:12:22 +05:45
1 parent a2e9167654
commit 0586d3a669
14 files changed
+149 -60

No files matched your search

+1 -1
View File
@@ -106,7 +106,7 @@ require (
golang.org/x/term v0.45.0
golang.org/x/text v0.41.0
google.golang.org/genproto/googleapis/api v0.0.0-20260803160001-6ac0973c030d
google.golang.org/grpc v1.83.0
google.golang.org/grpc v1.83.1
google.golang.org/protobuf v1.36.12
gopkg.in/yaml.v2 v2.4.0
gotest.tools/v3 v3.5.2
+2 -2
View File
@@ -1343,8 +1343,8 @@ google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3Iji
google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc=
google.golang.org/grpc v1.83.0 h1:JeNZEKJFbQxArAMl+hiytHauacDNqJUllNfmIMmpqnQ=
google.golang.org/grpc v1.83.0/go.mod h1:kDyl6SKsiHKt0uylY5gtn5cEjkrIOhQOGDgIc4JGwzQ=
google.golang.org/grpc v1.83.1 h1:HIO0+BEtBP6soyqvqC8sNUjZ7bTs+0hFQuFF+RAy++Y=
google.golang.org/grpc v1.83.1/go.mod h1:kDyl6SKsiHKt0uylY5gtn5cEjkrIOhQOGDgIc4JGwzQ=
google.golang.org/grpc/examples v0.0.0-20211102180624-670c133e568e h1:m7aQHHqd0q89mRwhwS9Bx2rjyl/hsFAeta+uGrHsQaU=
google.golang.org/grpc/examples v0.0.0-20211102180624-670c133e568e/go.mod h1:gID3PKrg7pWKntu9Ss6zTLJ0ttC0X9IHgREOCZwbCVU=
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
+11 -1
View File
@@ -150,8 +150,18 @@ var (
// throttling limit if unforeseen issues arise, and it will be removed in a
// future release.
//
// TODO: Remove this env var once v1.83.0 is release.
// TODO: Remove this env var once v1.83.0 is released.
ControlBufferThrottleLimit = uint64FromEnv("GRPC_GO_EXPERIMENTAL_CONTROL_BUFFER_THROTTLE_LIMIT", 100, 1, 10000)
// EnableReceiveBufferCompaction enables the compaction of data buffers
// to reduce the number of buffers in the receive buffer.
//
// This environment variable serves as an escape hatch to disable the
// feature if unforeseen issues arise, and it will be removed in a future
// release.
//
// TODO: Remove this env var once v1.85.0 is released.
EnableReceiveBufferCompaction = boolFromEnv("GRPC_GO_EXPERIMENTAL_ENABLE_RECEIVE_BUFFER_COMPACTION", true)
)
func boolFromEnv(envVar string, def bool) bool {
+14
View File
@@ -26,12 +26,26 @@ import (
"slices"
"sort"
"sync"
"google.golang.org/grpc/internal"
)
const (
goPageSize = 4 * 1024 // 4KiB. N.B. this must be a power of 2.
)
var (
// BufferPoolingThreshold is the minimum size of a buffer that can be pooled.
// This is used to determine whether to pool buffers or allocate them directly.
BufferPoolingThreshold = 1 << 10
)
func init() {
internal.SetBufferPoolingThresholdForTesting = func(threshold int) {
BufferPoolingThreshold = threshold
}
}
var uintSize = bits.UintSize // use a variable for mocking during tests.
// bufferPool is a copy of the public bufferPool interface used to avoid
+1 -1
View File
@@ -424,7 +424,7 @@ func (ht *serverHandlerTransport) HandleStreams(ctx context.Context, startStream
st: ht,
headerWireLength: 0, // won't have access to header wire length until golang/go#18997.
}
s.Stream.buf.init()
s.Stream.buf.init(ht.bufferPool)
s.readRequester = s
s.trReader = transportReader{
reader: recvBufferReader{ctx: s.ctx, ctxDone: s.ctx.Done(), recv: &s.buf},
+1 -1
View File
@@ -500,7 +500,7 @@ func (t *http2Client) newStream(ctx context.Context, callHdr *CallHdr, handler s
headerChan: make(chan struct{}),
statsHandler: handler,
}
s.Stream.buf.init()
s.Stream.buf.init(t.bufferPool)
s.Stream.wq.init(defaultWriteQuota, s.done)
s.readRequester = s
// The client side stream context should have exactly the same life cycle with the user provided context.
+1 -1
View File
@@ -407,7 +407,7 @@ func (t *http2Server) operateHeaders(ctx context.Context, frame *http2.MetaHeade
st: t,
headerWireLength: int(frame.Header().Length),
}
s.Stream.buf.init()
s.Stream.buf.init(t.bufferPool)
var (
// if false, content-type was missing or invalid
isGRPC = false
+104 -6
View File
@@ -30,11 +30,14 @@ import (
"sync"
"sync/atomic"
"time"
"unsafe"
"golang.org/x/net/http2"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/credentials"
"google.golang.org/grpc/internal/channelz"
"google.golang.org/grpc/internal/envconfig"
imem "google.golang.org/grpc/internal/mem"
"google.golang.org/grpc/internal/transport/internal"
"google.golang.org/grpc/keepalive"
"google.golang.org/grpc/mem"
@@ -45,7 +48,30 @@ import (
"google.golang.org/grpc/tap"
)
const logLevel = 2
const (
logLevel = 2
// recvMsgSize estimates the memory overhead of a recvMsg in the backlog.
// It accounts for the recvMsg struct itself and the slice header of the
// underlying buffer's data.
recvMsgSize = int(unsafe.Sizeof(recvMsg{}) + unsafe.Sizeof([]byte{}))
// utilizationFactor controls when we consider memory utilization acceptable.
// When backlogHeapSize / payloadSize <= utilizationFactor (meaning at least
// 50% of the heap memory is actual payload data), compaction is skipped.
utilizationFactor = 2
)
var (
// compactionThreshold is approx 57KB (on 64-bit systems). It allows
// accumulating up to 1024 1-byte payloads before triggering compaction.
//
// Because individual payloads <= 1024 bytes are allocated on the heap
// outside mem.BufferPool, waiting for at least 1024 bytes to accumulate
// ensures that compaction coalesces those small heap allocations into a
// single large buffer from mem.BufferPool, enabling buffer reuse while
// avoiding frequent copying for small bursts of frames.
compactionThreshold = imem.BufferPoolingThreshold * (recvMsgSize + 1)
)
func init() {
internal.TimeNowFunc = func() int64 { return time.Now().UnixNano() }
@@ -71,23 +97,31 @@ type recvBuffer struct {
c chan recvMsg
mu sync.Mutex
backlog []recvMsg
err error
// uncompactedSuffixLen tracks the number of consecutive data messages at
// the tail of backlog that have not been compacted.
uncompactedSuffixLen int
// uncompactedBytes tracks the total payload bytes across the trailing
// uncompactedSuffixLen messages.
uncompactedBytes int
err error
bufPool mem.BufferPool
}
// init allows a recvBuffer to be initialized in-place, which is useful
// for resetting a buffer or for avoiding a heap allocation when the buffer
// is embedded in another struct.
func (b *recvBuffer) init() {
func (b *recvBuffer) init(pool mem.BufferPool) {
b.c = make(chan recvMsg, 1)
b.bufPool = pool
}
func (b *recvBuffer) put(r recvMsg) {
b.mu.Lock()
defer b.mu.Unlock()
if b.err != nil {
// drop the buffer on the floor. Since b.err is not nil, any subsequent reads
// will always return an error, making this buffer inaccessible.
r.buffer.Free()
b.mu.Unlock()
// An error had occurred earlier, don't accept more
// data or errors.
return
@@ -96,13 +130,70 @@ func (b *recvBuffer) put(r recvMsg) {
if len(b.backlog) == 0 {
select {
case b.c <- r:
b.mu.Unlock()
return
default:
}
}
b.backlog = append(b.backlog, r)
b.mu.Unlock()
b.compactBacklogLocked(r)
}
func (b *recvBuffer) compactBacklogLocked(r recvMsg) {
if !envconfig.EnableReceiveBufferCompaction {
return
}
if r.buffer == nil {
b.uncompactedBytes = 0
b.uncompactedSuffixLen = 0
return
}
b.uncompactedSuffixLen++
b.uncompactedBytes += r.buffer.Len()
backlogHeapSize := b.uncompactedSuffixLen*recvMsgSize + b.uncompactedBytes
// If the memory overhead is less than 50% of the heap usage (e.g., because
// a large DATA frame arrived), the average message size in the suffix is
// large enough that memory bloat is not a concern. Reset suffix tracking.
if backlogHeapSize <= utilizationFactor*b.uncompactedBytes {
b.uncompactedBytes = 0
b.uncompactedSuffixLen = 0
return
}
// Avoid compacting too frequently for short bursts of small frames.
// Wait until we have accumulated at least ~1024 small messages (~57 KB).
if backlogHeapSize <= compactionThreshold {
// Still can accumulate more payloads.
return
}
// Since the memory utilization is less than 50%, the average payload size
// of each recvMsg must be less than recvMsgSize (approx 56 bytes).
// In the worst case for bytes copied (where the average payload is just
// below recvMsgSize), compaction will occur once every:
// compactionThreshold / (recvMsgSize + avg_payload) = ~520 messages,
// copying ~29KB of data.
start := 0
newBuf := b.bufPool.Get(b.uncompactedBytes)
startIdx := len(b.backlog) - b.uncompactedSuffixLen
for i := startIdx; i < len(b.backlog); i++ {
m := b.backlog[i]
b.backlog[i] = recvMsg{}
start += copy((*newBuf)[start:], m.buffer.ReadOnlyData())
m.buffer.Free()
}
b.backlog[startIdx] = recvMsg{
buffer: mem.NewBuffer(newBuf, b.bufPool),
}
b.backlog = b.backlog[:startIdx+1]
// After compaction, the suffix is replaced with a single message containing
// the combined payload. The new utilization is close to 1.0 (overhead of
// one recvMsg relative to the large compacted payload), which is well
// below the utilization factor of 2.
b.uncompactedBytes = 0
b.uncompactedSuffixLen = 0
}
func (b *recvBuffer) load() {
@@ -110,6 +201,13 @@ func (b *recvBuffer) load() {
if len(b.backlog) > 0 {
select {
case b.c <- b.backlog[0]:
// backlog[0] is only part of the tracked uncompacted suffix if the
// entire backlog currently consists of the suffix. If an earlier
// compaction or reset occurred, backlog[0] is already compacted.
if envconfig.EnableReceiveBufferCompaction && b.uncompactedSuffixLen == len(b.backlog) {
b.uncompactedSuffixLen--
b.uncompactedBytes -= b.backlog[0].buffer.Len()
}
b.backlog[0] = recvMsg{}
b.backlog = b.backlog[1:]
default:
-4
View File
@@ -59,10 +59,6 @@ func init() {
internal.SetDefaultBufferPool = func(pool BufferPool) {
defaultBufferPool = pool
}
internal.SetBufferPoolingThresholdForTesting = func(threshold int) {
bufferPoolingThreshold = threshold
}
}
// DefaultBufferPool returns the current default buffer pool. It is a BufferPool
+3 -3
View File
@@ -29,6 +29,8 @@ import (
"fmt"
"sync"
"sync/atomic"
"google.golang.org/grpc/internal/mem"
)
// A Buffer represents a reference counted piece of data (in bytes) that can be
@@ -63,8 +65,6 @@ type Buffer interface {
}
var (
bufferPoolingThreshold = 1 << 10
bufferObjectPool = sync.Pool{New: func() any { return new(buffer) }}
)
@@ -72,7 +72,7 @@ var (
// equal to the threshold for buffer pooling. This is used to determine whether
// to pool buffers or allocate them directly.
func IsBelowBufferPoolingThreshold(size int) bool {
return size <= bufferPoolingThreshold
return size <= mem.BufferPoolingThreshold
}
type buffer struct {
+1 -1
View File
@@ -19,4 +19,4 @@
package grpc
// Version is the current grpc version.
const Version = "1.83.0"
const Version = "1.83.1"
+1 -1
View File
@@ -2419,7 +2419,7 @@ google.golang.org/genproto/googleapis/api/httpbody
## explicit; go 1.25.0
google.golang.org/genproto/googleapis/rpc/errdetails
google.golang.org/genproto/googleapis/rpc/status
# google.golang.org/grpc v1.83.0
# google.golang.org/grpc v1.83.1
## explicit; go 1.25.0
google.golang.org/grpc
google.golang.org/grpc/attributes
+2 -1
View File
@@ -117,7 +117,8 @@
"brace-expansion": "5.0.9",
"ws": "8.21.0",
"js-yaml": "4.3.1",
"fast-uri": "3.1.5"
"fast-uri": "3.1.5",
"browserslist": "4.28.7"
},
"patchedDependencies": {
"caf@15.0.1": "patches/caf@15.0.1.patch",
+7 -37
View File
@@ -21,6 +21,7 @@ overrides:
ws: 8.21.0
js-yaml: 4.3.1
fast-uri: 3.1.5
browserslist: 4.28.7
patchedDependencies:
caf@15.0.1:
@@ -3864,11 +3865,6 @@ packages:
base64-js@1.5.1:
resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==}
baseline-browser-mapping@2.10.44:
resolution: {integrity: sha512-T3ghW+sl/ZJ8w1v/yQx3qvJ9040DWoLBz8JT/CILbAKcFyG9b2MRe75v6W5uXjv6uH1lumK2Kv46y2zSkcej0Q==}
engines: {node: '>=6.0.0'}
hasBin: true
baseline-browser-mapping@2.11.0:
resolution: {integrity: sha512-oCu2wfipvX3AePSgmOuKkIywOu+8n9psz7hXYmk56ghpu3+7KzNIBopaOs4c9BrtdnTtW30unG9GTfHo7EwERQ==}
engines: {node: '>=6.0.0'}
@@ -3938,19 +3934,14 @@ packages:
engines: {node: '>=18'}
hasBin: true
peerDependencies:
browserslist: '*'
browserslist: 4.28.7
browserslist-useragent-regexp@4.1.4:
resolution: {integrity: sha512-DgA+gTG1GCU0HGk/KUgYVpGhKZSt2vpirIGeKHla/zd9ALtM+nA8WAUGXhwp63D8gnA7g5fP7FGjNZOQO3fk7w==}
engines: {node: '>=14.0.0'}
hasBin: true
peerDependencies:
browserslist: '>=4.0.0'
browserslist@4.28.6:
resolution: {integrity: sha512-FQBYNK15VMslhLHpA7+n+n1GOlF1kId2xcCg7/j95f24AOF6VDYMNH4mFxF7KuaTdv627faazpOAjFzMrfJOUw==}
engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7}
hasBin: true
browserslist: 4.28.7
browserslist@4.28.7:
resolution: {integrity: sha512-JxV13hNrFxqjOc8alRbq9dK1MM79NEXYpma2B2J4wAtpWS5zIEIKqWPGCl7N4o7Uc7B7itylh7SuDujATRyyTw==}
@@ -4496,9 +4487,6 @@ packages:
engines: {node: '>=0.12.18'}
hasBin: true
electron-to-chromium@1.5.394:
resolution: {integrity: sha512-Wmt2Gm0o8JWBuGgmc4XZ0u9s1RaCRqhxP47phplmfg04+qypTUurpeJGP45A7Fhv7jdrrVH44PLlR9qXo37cVQ==}
electron-to-chromium@1.5.395:
resolution: {integrity: sha512-7zt9Aw+SrmxLWLN0zhaTWZQiCdryLVrYTq5R7iZakLvi2UQPYMMsROYV/2qVCzMeCiSXHwKOU+sZ4zOVVlrtKA==}
@@ -7075,7 +7063,7 @@ packages:
resolution: {integrity: sha512-Js0m9cx+qOgDxo0eMiFGEueWztz+d4+M3rGlmKPT+T4IS/jP4ylw3Nwpu6cpTTP8R1MAC1kF4VbdLt3ARf209w==}
hasBin: true
peerDependencies:
browserslist: '>= 4.21.0'
browserslist: 4.28.7
uri-js@4.4.1:
resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==}
@@ -7629,7 +7617,7 @@ snapshots:
dependencies:
'@babel/compat-data': 7.29.7
'@babel/helper-validator-option': 7.29.7
browserslist: 4.28.6
browserslist: 4.28.7
lru-cache: 5.1.1
semver: 6.3.1
@@ -10543,7 +10531,7 @@ snapshots:
autoprefixer@10.4.22(postcss@8.5.21):
dependencies:
browserslist: 4.28.6
browserslist: 4.28.7
caniuse-lite: 1.0.30001806
fraction.js: 5.3.4
normalize-range: 0.1.2
@@ -10618,8 +10606,6 @@ snapshots:
base64-js@1.5.1: {}
baseline-browser-mapping@2.10.44: {}
baseline-browser-mapping@2.11.0: {}
bidi-js@1.0.3:
@@ -10712,14 +10698,6 @@ snapshots:
regexp-tree: 0.1.27
ua-regexes-lite: 1.2.1
browserslist@4.28.6:
dependencies:
baseline-browser-mapping: 2.10.44
caniuse-lite: 1.0.30001806
electron-to-chromium: 1.5.394
node-releases: 2.0.51
update-browserslist-db: 1.2.3(browserslist@4.28.6)
browserslist@4.28.7:
dependencies:
baseline-browser-mapping: 2.11.0
@@ -10917,7 +10895,7 @@ snapshots:
core-js-compat@3.49.0:
dependencies:
browserslist: 4.28.6
browserslist: 4.28.7
core-js@3.49.0: {}
@@ -11313,8 +11291,6 @@ snapshots:
dependencies:
jake: 10.9.4
electron-to-chromium@1.5.394: {}
electron-to-chromium@1.5.395: {}
elliptic@6.6.1:
@@ -14028,12 +14004,6 @@ snapshots:
vite: 7.3.5(@types/node@24.13.2)(sass@1.94.1)(terser@5.49.0)(yaml@2.9.0)
webpack: 5.108.4(esbuild@0.27.7)
update-browserslist-db@1.2.3(browserslist@4.28.6):
dependencies:
browserslist: 4.28.6
escalade: 3.2.0
picocolors: 1.1.1
update-browserslist-db@1.2.3(browserslist@4.28.7):
dependencies:
browserslist: 4.28.7