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

Remove patch version #2

Closed
wants to merge 57 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
d9d8f34
revert xds: return all ServerConfig dial options together (#7712)
eshitachandwani Oct 9, 2024
b8ee37d
pickfirst: Move var for mocking the shuffle func from internal/intern…
arjan-bal Oct 9, 2024
4115c21
xds: return all ServerConfig dial options together (#7718)
eshitachandwani Oct 9, 2024
fdc2ec2
xdsclient: deflake TestADS_ResourcesAreRequestedAfterStreamRestart (#…
easwars Oct 9, 2024
18a4eac
testutils: add couple of log statements to the restartable listener t…
easwars Oct 9, 2024
00b9e14
pickfirst: New pick first policy for dualstack (#7498)
arjan-bal Oct 10, 2024
b850ea5
transport : wait for goroutines to exit before transport closes (#7666)
eshitachandwani Oct 10, 2024
ad81c20
pickfirstleaf: minor simplification to reconcileSubConnsLocked method…
easwars Oct 14, 2024
54841ef
stats/opentelemetry/csm: Get mesh_id local label from "CSM_MESH_ID" …
zasweq Oct 15, 2024
4544b8a
Change version to 1.69.0-dev (#7746)
purnesh42H Oct 16, 2024
569c8eb
vet: Use go1.22 instead of go1.21 for tidy and staticcheck(#7747)
arjan-bal Oct 16, 2024
6cd00c9
clientconn: remove redundant check (#7700)
luxcgo Oct 16, 2024
ec10e73
transport: refactor `trInFlow.onData` to eliminate redundant logic (#…
luxcgo Oct 16, 2024
d2ded4b
xdsclient: new Transport interface and LRS stream implementation (#7717)
easwars Oct 17, 2024
830135e
xdsclient: new Transport interface and ADS stream implementation (#7721)
easwars Oct 17, 2024
56df169
resolver: update ReportError() docstring (#7732)
purnesh42H Oct 17, 2024
98959d9
deps: update dependencies for all modules (#7755)
purnesh42H Oct 18, 2024
14e2a20
resolver/google-c2p: introduce SetUniverseDomain API (#7719)
apolcyn Oct 21, 2024
c538c31
vet: Don't use GOROOT to set PATH if GOROOT is unset (#7761)
arjan-bal Oct 22, 2024
80937a9
credentials: Apply defaults to TLS configs provided through GetConfig…
arjan-bal Oct 22, 2024
4bb0170
status: Fix status incompatibility introduced by #6919 and move non-r…
arjan-bal Oct 22, 2024
8212cf0
xdsclient: implementation of the xdsChannel (#7757)
easwars Oct 23, 2024
c4c8b11
xds/resolver: add a way to specify the xDS client to use for testing …
easwars Oct 24, 2024
f8e5d8f
mem: use slice capacity instead of length, to determine whether to po…
PapaCharlie Oct 24, 2024
e0a730c
clusterresolver: fix a comment in a test (#7776)
easwars Oct 25, 2024
a82315c
testutils: change ListenerWrapper to push the most recently accepted …
easwars Oct 25, 2024
94e1b29
vet: add dependency checks (#7766)
dfawley Oct 25, 2024
67b9ebf
xdsclient: make sending requests more deterministic (#7774)
easwars Oct 25, 2024
a0cbb52
github: add Go 1.23 testing and make staticcheck work locally with go…
arjan-bal Oct 25, 2024
cb32937
credentials: Support ALTSPerRPCCreds in DefaultCredentialsOptions (#7…
rockspore Oct 25, 2024
ada6787
cleanup: switching to stubserver in tests instead of testservice impl…
janardhanvissa Oct 28, 2024
4084b14
stats/opentelemetry: Remove OpenTelemetry module and add RLS Metrics …
zasweq Oct 28, 2024
e7435d6
balancer/endpointsharding: Ignore empty endpoints (#7674)
zasweq Oct 28, 2024
192ee33
multiple: add verbosity checks to logs that use pretty.JSON (#7785)
easwars Oct 28, 2024
091d20b
server: Only call FromIncomingContext with stats handlers (#7781)
evanj Oct 29, 2024
6fd86d3
Disable buffer_pooling tests (#7762)
aranjans Oct 29, 2024
52d7f6a
multiple: switch to math/rand/v2 (#7711)
marcoferrer Oct 29, 2024
2e3f547
ringhash: fix a couple of flakes in e2e style tests (#7784)
easwars Oct 29, 2024
d66fc3a
balancer/endpointsharding: Call ExitIdle() on child if child reports …
zasweq Oct 29, 2024
ef0f617
xdsclient: start using the newly added transport and channel function…
easwars Nov 1, 2024
70e8931
transport: remove useless trampoline function (#7801)
dfawley Nov 1, 2024
2a18bfc
transport: refactor to split ClientStream from ServerStream from comm…
dfawley Nov 4, 2024
2de6df9
xds/resolver: fix flaky test TestResolverRemovedWithRPCs with a worka…
easwars Nov 5, 2024
43ee172
balancer: Enforce embedding the SubConn interface in implementations …
arjan-bal Nov 5, 2024
0ec8fd8
xdsclient/ads: reset the pending bit of ADS stream flow control at th…
easwars Nov 5, 2024
e9ac44c
cleanup: replace grpc.Dial with grpc.NewClient in grpclb test (#7789)
hanut19 Nov 5, 2024
18d218d
pickfirst: Interleave IPv6 and IPv4 addresses for happy eyeballs (#7742)
arjan-bal Nov 6, 2024
b3393d9
xdsclient: support fallback within an authority (#7701)
easwars Nov 6, 2024
5b40f07
xdsclient: fix flaky test TestServeAndCloseDoNotRace (#7814)
easwars Nov 7, 2024
74738cf
grpc: Remove health check func dial option used for testing (#7820)
arjan-bal Nov 8, 2024
a3a8657
clusterimpl: update picker synchronously on config update (#7652)
aranjans Nov 8, 2024
0d0e530
grpc: export MethodHandler #7794 (#7796)
mohdjishin Nov 11, 2024
c2a2d20
docs: update documentation for `ClientStream.SendMsg()` returning `ni…
hanut19 Nov 11, 2024
d2c1aae
xds: Plumb EDS endpoints through xDS Balancer Tree (#7816)
zasweq Nov 11, 2024
60c70a4
mem: implement `ReadAll()` for more efficient `io.Reader` consumption…
ash2k Nov 12, 2024
e2b98f9
pickfirst: Implement Happy Eyeballs (#7725)
arjan-bal Nov 12, 2024
8338c5d
Remove go patch version from go.mod
arjan-bal Nov 12, 2024
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
3 changes: 3 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ jobs:
- name: Run coverage
run: go test -coverprofile=coverage.out -coverpkg=./... ./...

- name: Run coverage with new pickfirst
run: GRPC_EXPERIMENTAL_ENABLE_NEW_PICK_FIRST=true go test -coverprofile=coverage_new_pickfirst.out -coverpkg=./... ./...

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
Expand Down
43 changes: 43 additions & 0 deletions .github/workflows/deps.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Dependency Changes

# Trigger on PRs.
on:
pull_request:

permissions:
contents: read

jobs:
# Compare dependencies before and after this PR.
dependencies:
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
fail-fast: true

steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: stable
cache-dependency-path: "**/*go.sum"

# Run the commands to generate dependencies before and after and compare.
- name: Compare dependencies
run: |
BEFORE="$(mktemp -d)"
AFTER="$(mktemp -d)"

scripts/gen-deps.sh "${AFTER}"
git checkout origin/master
scripts/gen-deps.sh "${BEFORE}"

echo "Comparing dependencies..."
# Run grep in a sub-shell since bash does not support ! in the middle of a pipe
diff -u0 -r "${BEFORE}" "${AFTER}" | bash -c '! grep -v "@@"'
echo "No changes detected."
21 changes: 11 additions & 10 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.22'
go-version: '1.23'
cache-dependency-path: "**/go.sum"

# Run the vet-proto checks.
Expand All @@ -46,29 +46,30 @@ jobs:
goversion: '1.22'

- type: extras
goversion: '1.22'
goversion: '1.23'

- type: tests
goversion: '1.22'
goversion: '1.23'

- type: tests
goversion: '1.22'
goversion: '1.23'
testflags: -race

- type: tests
goversion: '1.22'
testflags: '-race -tags=buffer_pooling'
goversion: '1.23'
goarch: 386

- type: tests
goversion: '1.22'
goarch: 386
goversion: '1.23'
goarch: arm64

- type: tests
goversion: '1.22'
goarch: arm64

- type: tests
goversion: '1.21'
goversion: '1.23'
testflags: -race
grpcenv: 'GRPC_EXPERIMENTAL_ENABLE_NEW_PICK_FIRST=true'

steps:
# Setup the environment.
Expand Down
3 changes: 3 additions & 0 deletions balancer/balancer.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,9 @@ type SubConn interface {
// indicate the shutdown operation. This may be delivered before
// in-progress RPCs are complete and the actual connection is closed.
Shutdown()
// enforceEmbedding is an unexported method to force implementers embed
// this interface, allowing gRPC to add methods without breaking users.
enforceEmbedding()
}

// NewSubConnOptions contains options to create new SubConn.
Expand Down
1 change: 1 addition & 0 deletions balancer/base/balancer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ func (c *testClientConn) NewSubConn(addrs []resolver.Address, opts balancer.NewS
func (c *testClientConn) UpdateState(balancer.State) {}

type testSubConn struct {
balancer.SubConn
updateState func(balancer.SubConnState)
}

Expand Down
43 changes: 28 additions & 15 deletions balancer/endpointsharding/endpointsharding.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ package endpointsharding
import (
"encoding/json"
"errors"
"fmt"
"math/rand"
"sync"
"sync/atomic"

rand "math/rand/v2"

"google.golang.org/grpc/balancer"
"google.golang.org/grpc/balancer/base"
"google.golang.org/grpc/connectivity"
Expand Down Expand Up @@ -66,7 +66,9 @@ type endpointSharding struct {
cc balancer.ClientConn
bOpts balancer.BuildOptions

childMu sync.Mutex // syncs balancer.Balancer calls into children
children atomic.Pointer[resolver.EndpointMap]
closed bool

// inhibitChildUpdates is set during UpdateClientConnState/ResolverError
// calls (calls to children will each produce an update, only want one
Expand All @@ -80,19 +82,11 @@ type endpointSharding struct {
// for endpoints that are no longer present. It also updates all the children,
// and sends a single synchronous update of the childrens' aggregated state at
// the end of the UpdateClientConnState operation. If any endpoint has no
// addresses, returns error without forwarding any updates. Otherwise returns
// first error found from a child, but fully processes the new update.
// addresses it will ignore that endpoint. Otherwise, returns first error found
// from a child, but fully processes the new update.
func (es *endpointSharding) UpdateClientConnState(state balancer.ClientConnState) error {
if len(state.ResolverState.Endpoints) == 0 {
return errors.New("endpoints list is empty")
}
// Check/return early if any endpoints have no addresses.
// TODO: make this configurable if needed.
for i, endpoint := range state.ResolverState.Endpoints {
if len(endpoint.Addresses) == 0 {
return fmt.Errorf("endpoint %d has empty addresses", i)
}
}
es.childMu.Lock()
defer es.childMu.Unlock()

es.inhibitChildUpdates.Store(true)
defer func() {
Expand All @@ -106,6 +100,9 @@ func (es *endpointSharding) UpdateClientConnState(state balancer.ClientConnState

// Update/Create new children.
for _, endpoint := range state.ResolverState.Endpoints {
if len(endpoint.Addresses) == 0 {
continue
}
if _, ok := newChildren.Get(endpoint); ok {
// Endpoint child was already created, continue to avoid duplicate
// update.
Expand Down Expand Up @@ -153,6 +150,8 @@ func (es *endpointSharding) UpdateClientConnState(state balancer.ClientConnState
// children and sends a single synchronous update of the childStates at the end
// of the ResolverError operation.
func (es *endpointSharding) ResolverError(err error) {
es.childMu.Lock()
defer es.childMu.Unlock()
es.inhibitChildUpdates.Store(true)
defer func() {
es.inhibitChildUpdates.Store(false)
Expand All @@ -170,11 +169,14 @@ func (es *endpointSharding) UpdateSubConnState(balancer.SubConn, balancer.SubCon
}

func (es *endpointSharding) Close() {
es.childMu.Lock()
defer es.childMu.Unlock()
children := es.children.Load()
for _, child := range children.Values() {
bal := child.(balancer.Balancer)
bal.Close()
}
es.closed = true
}

// updateState updates this component's state. It sends the aggregated state,
Expand Down Expand Up @@ -234,7 +236,7 @@ func (es *endpointSharding) updateState() {
p := &pickerWithChildStates{
pickers: pickers,
childStates: childStates,
next: uint32(rand.Intn(len(pickers))),
next: uint32(rand.IntN(len(pickers))),
}
es.cc.UpdateState(balancer.State{
ConnectivityState: aggState,
Expand Down Expand Up @@ -282,6 +284,17 @@ func (bw *balancerWrapper) UpdateState(state balancer.State) {
bw.es.mu.Lock()
bw.childState.State = state
bw.es.mu.Unlock()
// When a child balancer says it's IDLE, ping it to exit idle and reconnect.
// TODO: In the future, perhaps make this a knob in configuration.
if ei, ok := bw.Balancer.(balancer.ExitIdler); state.ConnectivityState == connectivity.Idle && ok {
go func() {
bw.es.childMu.Lock()
if !bw.es.closed {
ei.ExitIdle()
}
bw.es.childMu.Unlock()
}()
}
bw.es.updateState()
}

Expand Down
Loading
Loading