transport: fix race causing flow control discrepancy when sending messages over server limit (#1859)
* In case of an error write transport quota back. * Added test.
This commit is contained in:
@ -888,6 +888,8 @@ func (t *http2Server) Write(s *Stream, hdr []byte, data []byte, opts *Options) e
|
||||
}
|
||||
ltq, _, err := t.localSendQuota.get(size, s.waiters)
|
||||
if err != nil {
|
||||
// Add the acquired quota back to transport.
|
||||
t.sendQuotaPool.add(tq)
|
||||
return err
|
||||
}
|
||||
// even if ltq is smaller than size we don't adjust size since,
|
||||
|
Reference in New Issue
Block a user