Skip to content

Commit d9d54a8

Browse files
committed
Merge remote-tracking branch 'origin/master' into e2e_test
2 parents a3ae7d2 + 29ba001 commit d9d54a8

302 files changed

Lines changed: 3208 additions & 1626 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/pull_request_template.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Thank you for your PR. Please read and follow
2+
https://github.com/grpc/grpc-go/blob/master/CONTRIBUTING.md, especially the
3+
"Guidelines for Pull Requests" section, and then delete this text before
4+
entering your PR description.

.github/workflows/testing.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
- name: Setup Go
2828
uses: actions/setup-go@v5
2929
with:
30-
go-version: '1.24'
30+
go-version: '1.25'
3131
cache-dependency-path: "**/go.sum"
3232

3333
# Run the vet-proto checks.
@@ -45,32 +45,32 @@ jobs:
4545
matrix:
4646
include:
4747
- type: vet
48-
goversion: '1.23'
48+
goversion: '1.24'
4949

5050
- type: extras
51-
goversion: '1.24'
51+
goversion: '1.25'
5252

5353
- type: tests
54-
goversion: '1.24'
54+
goversion: '1.25'
5555

5656
- type: tests
57-
goversion: '1.24'
57+
goversion: '1.25'
5858
testflags: -race
5959

6060
- type: tests
61-
goversion: '1.24'
61+
goversion: '1.25'
6262
goarch: 386
6363

6464
- type: tests
65-
goversion: '1.24'
65+
goversion: '1.25'
6666
goarch: arm64
6767
runner: ubuntu-24.04-arm
6868

6969
- type: tests
70-
goversion: '1.23'
70+
goversion: '1.24'
7171

7272
- type: tests
73-
goversion: '1.24'
73+
goversion: '1.25'
7474
testflags: -race
7575
grpcenv: 'GRPC_EXPERIMENTAL_ENABLE_NEW_PICK_FIRST=false'
7676

@@ -125,7 +125,7 @@ jobs:
125125
echo -e "\n-- Running Interop Test --"
126126
interop/interop_test.sh
127127
echo -e "\n-- Running xDS E2E Test --"
128-
xds/internal/test/e2e/run.sh
128+
internal/xds/test/e2e/run.sh
129129
echo -e "\n-- Running protoc-gen-go-grpc test --"
130130
./scripts/vet-proto.sh -install
131131
cmd/protoc-gen-go-grpc/protoc-gen-go-grpc_test.sh

CONTRIBUTING.md

Lines changed: 78 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,21 @@ guidelines, there may be valid reasons to do so, but it should be rare.
3333

3434
## Guidelines for Pull Requests
3535

36-
How to get your contributions merged smoothly and quickly:
36+
Please read the following carefully to ensure your contributions can be merged
37+
smoothly and quickly.
38+
39+
### PR Contents
3740

3841
- Create **small PRs** that are narrowly focused on **addressing a single
3942
concern**. We often receive PRs that attempt to fix several things at the same
4043
time, and if one part of the PR has a problem, that will hold up the entire
4144
PR.
4245

43-
- For **speculative changes**, consider opening an issue and discussing it
44-
first. If you are suggesting a behavioral or API change, consider starting
45-
with a [gRFC proposal](https://github.com/grpc/proposal). Many new features
46-
that are not bug fixes will require cross-language agreement.
46+
- If your change does not address an **open issue** with an **agreed
47+
resolution**, consider opening an issue and discussing it first. If you are
48+
suggesting a behavioral or API change, consider starting with a [gRFC
49+
proposal](https://github.com/grpc/proposal). Many new features that are not
50+
bug fixes will require cross-language agreement.
4751

4852
- If you want to fix **formatting or style**, consider whether your changes are
4953
an obvious improvement or might be considered a personal preference. If a
@@ -56,16 +60,6 @@ How to get your contributions merged smoothly and quickly:
5660
often written as "iff". Please do not make spelling correction changes unless
5761
you are certain they are misspellings.
5862

59-
- Provide a good **PR description** as a record of **what** change is being made
60-
and **why** it was made. Link to a GitHub issue if it exists.
61-
62-
- Maintain a **clean commit history** and use **meaningful commit messages**.
63-
PRs with messy commit histories are difficult to review and won't be merged.
64-
Before sending your PR, ensure your changes are based on top of the latest
65-
`upstream/master` commits, and avoid rebasing in the middle of a code review.
66-
You should **never use `git push -f`** unless absolutely necessary during a
67-
review, as it can interfere with GitHub's tracking of comments.
68-
6963
- **All tests need to be passing** before your change can be merged. We
7064
recommend you run tests locally before creating your PR to catch breakages
7165
early on:
@@ -81,15 +75,80 @@ How to get your contributions merged smoothly and quickly:
8175
GitHub, which will trigger a GitHub Actions run that you can use to verify
8276
everything is passing.
8377

84-
- If you are adding a new file, make sure it has the **copyright message**
78+
- Note that there are two GitHub actions checks that need not be green:
79+
80+
1. We test the freshness of the generated proto code we maintain via the
81+
`vet-proto` check. If the source proto files are updated, but our repo is
82+
not updated, an optional checker will fail. This will be fixed by our team
83+
in a separate PR and will not prevent the merge of your PR.
84+
85+
2. We run a checker that will fail if there is any change in dependencies of
86+
an exported package via the `dependencies` check. If new dependencies are
87+
added that are not appropriate, we may not accept your PR (see below).
88+
89+
- If you are adding a **new file**, make sure it has the **copyright message**
8590
template at the top as a comment. You can copy the message from an existing
8691
file and update the year.
8792

8893
- The grpc package should only depend on standard Go packages and a small number
8994
of exceptions. **If your contribution introduces new dependencies**, you will
90-
need a discussion with gRPC-Go maintainers. A GitHub action check will run on
91-
every PR, and will flag any transitive dependency changes from any public
92-
package.
95+
need a discussion with gRPC-Go maintainers.
96+
97+
### PR Descriptions
98+
99+
- **PR titles** should start with the name of the component being addressed, or
100+
the type of change. Examples: transport, client, server, round_robin, xds,
101+
cleanup, deps.
102+
103+
- Read and follow the **guidelines for PR titles and descriptions** here:
104+
https://google.github.io/eng-practices/review/developer/cl-descriptions.html
105+
106+
*particularly* the sections "First Line" and "Body is Informative".
107+
108+
Note: your PR description will be used as the git commit message in a
109+
squash-and-merge if your PR is approved. We may make changes to this as
110+
necessary.
111+
112+
- **Does this PR relate to an open issue?** On the first line, please use the
113+
tag `Fixes #<issue>` to ensure the issue is closed when the PR is merged. Or
114+
use `Updates #<issue>` if the PR is related to an open issue, but does not fix
115+
it. Consider filing an issue if one does not already exist.
116+
117+
- PR descriptions *must* conclude with **release notes** as follows:
118+
119+
```
120+
RELEASE NOTES:
121+
* <component>: <summary>
122+
```
123+
124+
This need not match the PR title.
125+
126+
The summary must:
127+
128+
* be something that gRPC users will understand.
129+
130+
* clearly explain the feature being added, the issue being fixed, or the
131+
behavior being changed, etc. If fixing a bug, be clear about how the bug
132+
can be triggered by an end-user.
133+
134+
* begin with a capital letter and use complete sentences.
135+
136+
* be as short as possible to describe the change being made.
137+
138+
If a PR is *not* end-user visible -- e.g. a cleanup, testing change, or
139+
GitHub-related, use `RELEASE NOTES: n/a`.
140+
141+
### PR Process
142+
143+
- Please **self-review** your code changes before sending your PR. This will
144+
prevent simple, obvious errors from causing delays.
145+
146+
- Maintain a **clean commit history** and use **meaningful commit messages**.
147+
PRs with messy commit histories are difficult to review and won't be merged.
148+
Before sending your PR, ensure your changes are based on top of the latest
149+
`upstream/master` commits, and avoid rebasing in the middle of a code review.
150+
You should **never use `git push -f`** unless absolutely necessary during a
151+
review, as it can interfere with GitHub's tracking of comments.
93152

94153
- Unless your PR is trivial, you should **expect reviewer comments** that you
95154
will need to address before merging. We'll label the PR as `Status: Requires
@@ -98,5 +157,3 @@ How to get your contributions merged smoothly and quickly:
98157
`stale`, and we will automatically close it after 7 days if we don't hear back
99158
from you. Please feel free to ping issues or bugs if you do not get a response
100159
within a week.
101-
102-
- Exceptions to the rules can be made if there's a compelling reason to do so.

balancer/grpclb/grpclb_remote_balancer.go

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -82,14 +82,8 @@ func (lb *lbBalancer) processServerList(l *lbpb.ServerList) {
8282
}
8383

8484
md := metadata.Pairs(lbTokenKey, s.LoadBalanceToken)
85-
ip := net.IP(s.IpAddress)
86-
ipStr := ip.String()
87-
if ip.To4() == nil {
88-
// Add square brackets to ipv6 addresses, otherwise net.Dial() and
89-
// net.SplitHostPort() will return too many colons error.
90-
ipStr = fmt.Sprintf("[%s]", ipStr)
91-
}
92-
addr := imetadata.Set(resolver.Address{Addr: fmt.Sprintf("%s:%d", ipStr, s.Port)}, md)
85+
ipStr := net.IP(s.IpAddress).String()
86+
addr := imetadata.Set(resolver.Address{Addr: net.JoinHostPort(ipStr, fmt.Sprintf("%d", s.Port))}, md)
9387
if lb.logger.V(2) {
9488
lb.logger.Infof("Server list entry:|%d|, ipStr:|%s|, port:|%d|, load balancer token:|%v|", i, ipStr, s.Port, s.LoadBalanceToken)
9589
}

balancer/pickfirst/pickfirstleaf/metrics_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ func (s) TestPickFirstMetricsE2E(t *testing.T) {
204204
{
205205
Name: "grpc.lb.pick_first.connection_attempts_succeeded",
206206
Description: "EXPERIMENTAL. Number of successful connection attempts.",
207-
Unit: "attempt",
207+
Unit: "{attempt}",
208208
Data: metricdata.Sum[int64]{
209209
DataPoints: []metricdata.DataPoint[int64]{
210210
{
@@ -219,7 +219,7 @@ func (s) TestPickFirstMetricsE2E(t *testing.T) {
219219
{
220220
Name: "grpc.lb.pick_first.connection_attempts_failed",
221221
Description: "EXPERIMENTAL. Number of failed connection attempts.",
222-
Unit: "attempt",
222+
Unit: "{attempt}",
223223
Data: metricdata.Sum[int64]{
224224
DataPoints: []metricdata.DataPoint[int64]{
225225
{
@@ -234,7 +234,7 @@ func (s) TestPickFirstMetricsE2E(t *testing.T) {
234234
{
235235
Name: "grpc.lb.pick_first.disconnections",
236236
Description: "EXPERIMENTAL. Number of times the selected subchannel becomes disconnected.",
237-
Unit: "disconnection",
237+
Unit: "{disconnection}",
238238
Data: metricdata.Sum[int64]{
239239
DataPoints: []metricdata.DataPoint[int64]{
240240
{

balancer/pickfirst/pickfirstleaf/pickfirstleaf.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,21 +67,21 @@ var (
6767
disconnectionsMetric = expstats.RegisterInt64Count(expstats.MetricDescriptor{
6868
Name: "grpc.lb.pick_first.disconnections",
6969
Description: "EXPERIMENTAL. Number of times the selected subchannel becomes disconnected.",
70-
Unit: "disconnection",
70+
Unit: "{disconnection}",
7171
Labels: []string{"grpc.target"},
7272
Default: false,
7373
})
7474
connectionAttemptsSucceededMetric = expstats.RegisterInt64Count(expstats.MetricDescriptor{
7575
Name: "grpc.lb.pick_first.connection_attempts_succeeded",
7676
Description: "EXPERIMENTAL. Number of successful connection attempts.",
77-
Unit: "attempt",
77+
Unit: "{attempt}",
7878
Labels: []string{"grpc.target"},
7979
Default: false,
8080
})
8181
connectionAttemptsFailedMetric = expstats.RegisterInt64Count(expstats.MetricDescriptor{
8282
Name: "grpc.lb.pick_first.connection_attempts_failed",
8383
Description: "EXPERIMENTAL. Number of failed connection attempts.",
84-
Unit: "attempt",
84+
Unit: "{attempt}",
8585
Labels: []string{"grpc.target"},
8686
Default: false,
8787
})

balancer/rls/balancer.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ var (
8282
cacheEntriesMetric = estats.RegisterInt64Gauge(estats.MetricDescriptor{
8383
Name: "grpc.lb.rls.cache_entries",
8484
Description: "EXPERIMENTAL. Number of entries in the RLS cache.",
85-
Unit: "entry",
85+
Unit: "{entry}",
8686
Labels: []string{"grpc.target", "grpc.lb.rls.server_target", "grpc.lb.rls.instance_uuid"},
8787
Default: false,
8888
})
@@ -96,21 +96,21 @@ var (
9696
defaultTargetPicksMetric = estats.RegisterInt64Count(estats.MetricDescriptor{
9797
Name: "grpc.lb.rls.default_target_picks",
9898
Description: "EXPERIMENTAL. Number of LB picks sent to the default target.",
99-
Unit: "pick",
99+
Unit: "{pick}",
100100
Labels: []string{"grpc.target", "grpc.lb.rls.server_target", "grpc.lb.rls.data_plane_target", "grpc.lb.pick_result"},
101101
Default: false,
102102
})
103103
targetPicksMetric = estats.RegisterInt64Count(estats.MetricDescriptor{
104104
Name: "grpc.lb.rls.target_picks",
105105
Description: "EXPERIMENTAL. Number of LB picks sent to each RLS target. Note that if the default target is also returned by the RLS server, RPCs sent to that target from the cache will be counted in this metric, not in grpc.rls.default_target_picks.",
106-
Unit: "pick",
106+
Unit: "{pick}",
107107
Labels: []string{"grpc.target", "grpc.lb.rls.server_target", "grpc.lb.rls.data_plane_target", "grpc.lb.pick_result"},
108108
Default: false,
109109
})
110110
failedPicksMetric = estats.RegisterInt64Count(estats.MetricDescriptor{
111111
Name: "grpc.lb.rls.failed_picks",
112112
Description: "EXPERIMENTAL. Number of LB picks failed due to either a failed RLS request or the RLS channel being throttled.",
113-
Unit: "pick",
113+
Unit: "{pick}",
114114
Labels: []string{"grpc.target", "grpc.lb.rls.server_target"},
115115
Default: false,
116116
})

balancer/rls/metrics_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ func (s) TestRLSTargetPickMetric(t *testing.T) {
9090
{
9191
Name: "grpc.lb.rls.target_picks",
9292
Description: "EXPERIMENTAL. Number of LB picks sent to each RLS target. Note that if the default target is also returned by the RLS server, RPCs sent to that target from the cache will be counted in this metric, not in grpc.rls.default_target_picks.",
93-
Unit: "pick",
93+
Unit: "{pick}",
9494
Data: metricdata.Sum[int64]{
9595
DataPoints: []metricdata.DataPoint[int64]{
9696
{
@@ -107,7 +107,7 @@ func (s) TestRLSTargetPickMetric(t *testing.T) {
107107
{
108108
Name: "grpc.lb.rls.cache_entries",
109109
Description: "EXPERIMENTAL. Number of entries in the RLS cache.",
110-
Unit: "entry",
110+
Unit: "{entry}",
111111
Data: metricdata.Gauge[int64]{
112112
DataPoints: []metricdata.DataPoint[int64]{
113113
{
@@ -201,7 +201,7 @@ func (s) TestRLSDefaultTargetPickMetric(t *testing.T) {
201201
{
202202
Name: "grpc.lb.rls.default_target_picks",
203203
Description: "EXPERIMENTAL. Number of LB picks sent to the default target.",
204-
Unit: "pick",
204+
Unit: "{pick}",
205205
Data: metricdata.Sum[int64]{
206206
DataPoints: []metricdata.DataPoint[int64]{
207207
{
@@ -218,7 +218,7 @@ func (s) TestRLSDefaultTargetPickMetric(t *testing.T) {
218218
{
219219
Name: "grpc.lb.rls.cache_entries",
220220
Description: "EXPERIMENTAL. Number of entries in the RLS cache.",
221-
Unit: "entry",
221+
Unit: "{entry}",
222222
Data: metricdata.Gauge[int64]{
223223
DataPoints: []metricdata.DataPoint[int64]{
224224
{
@@ -299,7 +299,7 @@ func (s) TestRLSFailedRPCMetric(t *testing.T) {
299299
{
300300
Name: "grpc.lb.rls.failed_picks",
301301
Description: "EXPERIMENTAL. Number of LB picks failed due to either a failed RLS request or the RLS channel being throttled.",
302-
Unit: "pick",
302+
Unit: "{pick}",
303303
Data: metricdata.Sum[int64]{
304304
DataPoints: []metricdata.DataPoint[int64]{
305305
{
@@ -315,7 +315,7 @@ func (s) TestRLSFailedRPCMetric(t *testing.T) {
315315
{
316316
Name: "grpc.lb.rls.cache_entries",
317317
Description: "EXPERIMENTAL. Number of entries in the RLS cache.",
318-
Unit: "entry",
318+
Unit: "{entry}",
319319
Data: metricdata.Gauge[int64]{
320320
DataPoints: []metricdata.DataPoint[int64]{
321321
{

balancer/weightedroundrobin/balancer.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ var (
6060
rrFallbackMetric = estats.RegisterInt64Count(estats.MetricDescriptor{
6161
Name: "grpc.lb.wrr.rr_fallback",
6262
Description: "EXPERIMENTAL. Number of scheduler updates in which there were not enough endpoints with valid weight, which caused the WRR policy to fall back to RR behavior.",
63-
Unit: "update",
63+
Unit: "{update}",
6464
Labels: []string{"grpc.target"},
6565
OptionalLabels: []string{"grpc.lb.locality"},
6666
Default: false,
@@ -69,7 +69,7 @@ var (
6969
endpointWeightNotYetUsableMetric = estats.RegisterInt64Count(estats.MetricDescriptor{
7070
Name: "grpc.lb.wrr.endpoint_weight_not_yet_usable",
7171
Description: "EXPERIMENTAL. Number of endpoints from each scheduler update that don't yet have usable weight information (i.e., either the load report has not yet been received, or it is within the blackout period).",
72-
Unit: "endpoint",
72+
Unit: "{endpoint}",
7373
Labels: []string{"grpc.target"},
7474
OptionalLabels: []string{"grpc.lb.locality"},
7575
Default: false,
@@ -78,15 +78,15 @@ var (
7878
endpointWeightStaleMetric = estats.RegisterInt64Count(estats.MetricDescriptor{
7979
Name: "grpc.lb.wrr.endpoint_weight_stale",
8080
Description: "EXPERIMENTAL. Number of endpoints from each scheduler update whose latest weight is older than the expiration period.",
81-
Unit: "endpoint",
81+
Unit: "{endpoint}",
8282
Labels: []string{"grpc.target"},
8383
OptionalLabels: []string{"grpc.lb.locality"},
8484
Default: false,
8585
})
8686
endpointWeightsMetric = estats.RegisterFloat64Histo(estats.MetricDescriptor{
8787
Name: "grpc.lb.wrr.endpoint_weights",
8888
Description: "EXPERIMENTAL. Weight of each endpoint, recorded on every scheduler update. Endpoints without usable weights will be recorded as weight 0.",
89-
Unit: "endpoint",
89+
Unit: "{endpoint}",
9090
Labels: []string{"grpc.target"},
9191
OptionalLabels: []string{"grpc.lb.locality"},
9292
Default: false,

0 commit comments

Comments
 (0)