-
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
chore: log when an invalid watch request is received #14351
Conversation
As protobuf doesn't have required field, user may send an empty WatchRequest by mistake. Currently, etcd will ignore the invalid request and keep the stream opening. If we don't reject the invalid request by closing the stream, it would be better to leave a log there. This commit also fixes a typo in the comment. Signed-off-by: spacewander <[email protected]>
Codecov Report
@@ Coverage Diff @@
## main #14351 +/- ##
==========================================
- Coverage 75.39% 75.33% -0.07%
==========================================
Files 457 457
Lines 37125 37117 -8
==========================================
- Hits 27991 27961 -30
- Misses 7377 7394 +17
- Partials 1757 1762 +5
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 |
server/etcdserver/api/v3rpc/watch.go
Outdated
// so just do nothing instead. | ||
sws.lg.Warn("invalid watch request received in gRPC stream") |
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.
Adding the request type
info will be more helpful to debug.
server/etcdserver/api/v3rpc/watch.go
Outdated
// so just do nothing instead. | ||
sws.lg.Warn("invalid watch request received in gRPC stream") |
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.
@spacewander thanks! Logging it for information purpose sounds good, and so I think the severity should be Info
(not warning).
Signed-off-by: spacewander <[email protected]>
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 @spacewander
As protobuf doesn't have required field, user may send an empty
WatchRequest by mistake. Currently, etcd will ignore the invalid request
and keep the stream opening. If we don't reject the invalid request by
closing the stream, it would be better to leave a log there.
This commit also fixes a typo in the comment.
Signed-off-by: spacewander [email protected]
Please read https://github.com/etcd-io/etcd/blob/main/CONTRIBUTING.md#contribution-flow.