TUN-1847: Log a distinct message when OpenStream fails while waiting for response headers

This commit is contained in:
Nick Vollmar 2019-05-13 16:46:25 -05:00
parent fa17b0200f
commit 6f8708d33c
2 changed files with 9 additions and 8 deletions

View File

@ -24,6 +24,7 @@ var (
ErrConnectionClosed = MuxerApplicationError{"3001 connection closed"} ErrConnectionClosed = MuxerApplicationError{"3001 connection closed"}
ErrConnectionDropped = MuxerApplicationError{"3002 connection dropped"} ErrConnectionDropped = MuxerApplicationError{"3002 connection dropped"}
ErrOpenStreamTimeout = MuxerApplicationError{"3003 open stream timeout"} ErrOpenStreamTimeout = MuxerApplicationError{"3003 open stream timeout"}
ErrResponseHeadersTimeout = MuxerApplicationError{"3004 timeout waiting for initial response headers"}
ErrClosedStream = MuxerStreamError{"4000 stream closed", http2.ErrCodeStreamClosed} ErrClosedStream = MuxerStreamError{"4000 stream closed", http2.ErrCodeStreamClosed}
) )

View File

@ -406,7 +406,7 @@ func (m *Muxer) OpenStream(ctx context.Context, headers []Header, body io.Reader
select { select {
case <-ctx.Done(): case <-ctx.Done():
return nil, ErrOpenStreamTimeout return nil, ErrResponseHeadersTimeout
case <-m.abortChan: case <-m.abortChan:
return nil, ErrConnectionClosed return nil, ErrConnectionClosed
case <-stream.responseHeadersReceived: case <-stream.responseHeadersReceived: