To adhere with protocol the server should send RST_STREAM on observing timeout on a strea, (#1130)
This commit is contained in:
Родитель
6914ab1e33
Коммит
6d0e6b04b3
|
@ -560,9 +560,12 @@ func (t *http2Client) CloseStream(s *Stream, err error) {
|
|||
}
|
||||
s.state = streamDone
|
||||
s.mu.Unlock()
|
||||
if _, ok := err.(StreamError); ok {
|
||||
if se, ok := err.(StreamError); ok {
|
||||
rstStream = true
|
||||
rstError = http2.ErrCodeCancel
|
||||
if se.Code == codes.DeadlineExceeded {
|
||||
rstError = http2.ErrCodeInternal
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -741,6 +741,9 @@ func (t *http2Server) WriteStatus(s *Stream, st *status.Status) error {
|
|||
}
|
||||
t.stats.HandleRPC(s.Context(), outTrailer)
|
||||
}
|
||||
if statusCode == codes.DeadlineExceeded {
|
||||
t.controlBuf.put(&resetStream{s.id, http2.ErrCodeInternal})
|
||||
}
|
||||
t.closeStream(s)
|
||||
t.writableChan <- 0
|
||||
return nil
|
||||
|
|
Загрузка…
Ссылка в новой задаче