Merge pull request #12925 from yangxuanjia/yxjetcd_check_resuming

check resuming len to avoid panic
release-3.5
Piotr Tabor 2021-05-12 09:18:40 +02:00 committed by GitHub
commit 3b24496c2a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 4 deletions

View File

@ -581,10 +581,12 @@ func (w *watchGrpcStream) run() {
switch {
case pbresp.Created:
// response to head of queue creation
if ws := w.resuming[0]; ws != nil {
w.addSubstream(pbresp, ws)
w.dispatchEvent(pbresp)
w.resuming[0] = nil
if len(w.resuming) != 0 {
if ws := w.resuming[0]; ws != nil {
w.addSubstream(pbresp, ws)
w.dispatchEvent(pbresp)
w.resuming[0] = nil
}
}
if ws := w.nextResume(); ws != nil {