mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
chore: log when an invalid watch request is received
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 <spacewanderlzx@gmail.com>
This commit is contained in:
parent
22cc682606
commit
bebefd8b80
@ -346,8 +346,9 @@ func (sws *serverWatchStream) recvLoop() error {
|
||||
}
|
||||
default:
|
||||
// we probably should not shutdown the entire stream when
|
||||
// receive an valid command.
|
||||
// receive an invalid command.
|
||||
// so just do nothing instead.
|
||||
sws.lg.Warn("invalid watch request received in gRPC stream")
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user