-
Notifications
You must be signed in to change notification settings - Fork 9.8k
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
refactor(client): remove duplicate processing #15032
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
THank you @wafuwafu13
c.GetLogger().Error("clientv3/retry_interceptor: getToken failed", zap.Error(err)) | ||
return nil, err | ||
} | ||
err := c.getToken(ctx) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a little confused. Are we getting a new token for each creation of a stream... and getting the token requires a separate call to etcd ? I thought we use token stored in the authTokenBundle... as long as we don't get error suggesting shouldRefreshToken
...
I know it's not change in this PR, but still if you know, please let me know.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't understand why getToken
needed to be called, but since it was mentioned in the comment, I didn't remove it.
But I think that getToken
is not reqired before RecvMsg
because getToken is called at client initialization and token is stored in the authTokenBundle.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Per my understanding streamClientInterceptor
is just a client side stream Interceptor, but etcd only uses server side streaming (watch stream and lease keep alive), so streamClientInterceptor
is only executed once on the very beginning of a stream. Note that for server-side streaming, the client side only calls SendMsg
once.
So actually the token will never be refreshed during a watch stream, and it's exactly the reason of #12385, which was resolved in #14322. But unfortunately, we rollbacked the fix due to some concern on K8s side. FYI. #14992
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update: lease keep alive
should be a bi-directional stream. The client side keeps sending LeaseKeepAliveRequest
, and server side responds with a LeaseKeepAliveResponse
each time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for letting me know. I added comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wafuwafu13 Please squash the commits and rebase this PR.
480aa83
to
7d389fa
Compare
Codecov Report
@@ Coverage Diff @@
## main #15032 +/- ##
==========================================
- Coverage 74.73% 74.69% -0.05%
==========================================
Files 415 415
Lines 34276 34275 -1
==========================================
- Hits 25617 25601 -16
- Misses 7017 7025 +8
- Partials 1642 1649 +7
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
b606721
to
5f31076
Compare
The second commit b606721 doesn't make any sense. Please rebase this PR instead of merging |
Signed-off-by: Benjamin Wang <wachao@vmware.com>
…gGRPCAuthOldRevision to cache gRPC error messages Signed-off-by: Benjamin Wang <wachao@vmware.com>
target.Endpoint and some other fields are deprecated, URL field is suggested to use instead path is required to be stripped of "/" prefix for naming/resolver to work porperly Signed-off-by: Ramil Mirhasanov <ramil600@yahoo.com>
Signed-off-by: Benjamin Wang <wachao@vmware.com>
Signed-off-by: Benjamin Wang <wachao@vmware.com>
Signed-off-by: Benjamin Wang <wachao@vmware.com>
Signed-off-by: Benjamin Wang <wachao@vmware.com>
Signed-off-by: Benjamin Wang <wachao@vmware.com>
Signed-off-by: Benjamin Wang <wachao@vmware.com>
Signed-off-by: Benjamin Wang <wachao@vmware.com>
Signed-off-by: Benjamin Wang <wachao@vmware.com>
Signed-off-by: Benjamin Wang <wachao@vmware.com>
Signed-off-by: Benjamin Wang <wachao@vmware.com>
Signed-off-by: Benjamin Wang <wachao@vmware.com>
Signed-off-by: Benjamin Wang <wachao@vmware.com>
…/mod Signed-off-by: Benjamin Wang <wachao@vmware.com>
…/mod Signed-off-by: Benjamin Wang <wachao@vmware.com>
Signed-off-by: Benjamin Wang <wachao@vmware.com>
Signed-off-by: Benjamin Wang <wachao@vmware.com>
…org/grpc/otelgrpc from 0.32.0 to 0.37.0 in /server Signed-off-by: Benjamin Wang <wachao@vmware.com>
Bumps [github.com/anishathalye/porcupine](https://github.com/anishathalye/porcupine) from 0.1.2 to 0.1.4. - [Release notes](https://github.com/anishathalye/porcupine/releases) - [Commits](anishathalye/porcupine@v0.1.2...v0.1.4) --- updated-dependencies: - dependency-name: github.com/anishathalye/porcupine dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
Bumps [honnef.co/go/tools](https://github.com/dominikh/go-tools) from 0.3.0 to 0.3.3. - [Release notes](https://github.com/dominikh/go-tools/releases) - [Commits](dominikh/go-tools@v0.3.0...v0.3.3) --- updated-dependencies: - dependency-name: honnef.co/go/tools dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
This PR will add `trivy-nightly-scan` for etcd images with versions `3.4.22` and `3.5.6` to scan for vulnerabilities everyday at 2AM UTC. Signed-off-by: ArkaSaha30 <arkasaha30@gmail.com>
Signed-off-by: ArkaSaha30 <arkasaha30@gmail.com>
Signed-off-by: ArkaSaha30 <arkasaha30@gmail.com>
Bumps [github.com/alexkohler/nakedret](https://github.com/alexkohler/nakedret) from 1.0.0 to 1.0.1. - [Release notes](https://github.com/alexkohler/nakedret/releases) - [Commits](alexkohler/nakedret@v1.0...v1.0.1) --- updated-dependencies: - dependency-name: github.com/alexkohler/nakedret dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 2.2.0 to 3.5.0. - [Release notes](https://github.com/actions/setup-go/releases) - [Commits](actions/setup-go@bfdd357...6edd440) --- updated-dependencies: - dependency-name: actions/setup-go dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
…n and old revision errors in watch' Signed-off-by: Benjamin Wang <wachao@vmware.com>
Signed-off-by: wafuwafu13 <mariobaske@i.softbank.jp>
Signed-off-by: wafuwafu13 <mariobaske@i.softbank.jp>
Signed-off-by: ZhengSheng0524 <j13tw@yahoo.com.tw>
Signed-off-by: ArkaSaha30 <arkasaha30@gmail.com>
We should call Wait for grpc-proxy process stop before start. Otherwise, the tcp port won't be released. Fixes: etcd-io#14926 Signed-off-by: Wei Fu <fuweid89@gmail.com>
Signed-off-by: Chao Chen <chaochn@amazon.com>
Signed-off-by: Wei Fu <fuweid89@gmail.com>
Signed-off-by: Oskar Haarklou Veileborg <ohv1020@hotmail.com>
Signed-off-by: Oskar Haarklou Veileborg <ohv1020@hotmail.com>
Signed-off-by: Ramil Mirhasanov <ramil600@yahoo.com>
Signed-off-by: Benjamin Wang <wachao@vmware.com>
Bumps [github.com/mikefarah/yq/v4](https://github.com/mikefarah/yq) from 4.30.5 to 4.30.6. - [Release notes](https://github.com/mikefarah/yq/releases) - [Changelog](https://github.com/mikefarah/yq/blob/master/release_notes.txt) - [Commits](mikefarah/yq@v4.30.5...v4.30.6) --- updated-dependencies: - dependency-name: github.com/mikefarah/yq/v4 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2.1.36 to 2.1.37. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](github/codeql-action@v2.1.36...959cbb7) --- updated-dependencies: - dependency-name: github/codeql-action dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
Bumps [ossf/scorecard-action](https://github.com/ossf/scorecard-action) from 2.0.6 to 2.1.0. - [Release notes](https://github.com/ossf/scorecard-action/releases) - [Changelog](https://github.com/ossf/scorecard-action/blob/main/RELEASE.md) - [Commits](ossf/scorecard-action@99c5375...937ffa9) --- updated-dependencies: - dependency-name: ossf/scorecard-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: wafuwafu13 <mariobaske@i.softbank.jp>
Signed-off-by: Unai Arrien <unaittxu@gmail.com>
Signed-off-by: wafuwafu13 <mariobaske@i.softbank.jp>
5f31076
to
db0514a
Compare
I made mistakes and will remake it. |
Signed-off-by: wafuwafu13 mariobaske@i.softbank.jp
c.authTokenBundle != nil
is equal toc.Username != "" && c.Password != ""
, andc.getToken
just returnnil
if eitherc.Username
orc.Password
is""
. soif c.authTokenBundle != nil
is unnecessary.getToken
returnsnil
iferr == rpctypes.ErrAuthNotEnabled
, and rpctypes.Error(err) != rpctypes.ErrAuthNotEnabled is alwaystrue
, so unnecessary.ref:
// TODO(cfc4n): keep this code block, remove codes about getToken in client.go after pr #12165 merged.
https://github.com/etcd-io/etcd/pull/12165/files