The current top error in StackDriver is "i/o timeout": link.
The stack trace indicates that this is logged here, which means the source of the error is this call to the next filter. The RecordOp filter is only used by proxy code here, which means that the next filter would be the cleanheadersfilter created on the next line. A quick inspection reveals that the cleanheadersfilterdoes not generate errors of its own.
Looking at the use of the filter chain, we can see that, at least for non-WSS proxies, the cleanheadersfilter is the last in the chain. So the next function returning the error must be provided by whoever calls Apply on the filter chain. As seen in the previous link, the filter chain is provided to getlantern/http-proxy/server.New, where it is passed to getlantern/proxy.New. There, Apply is only ever called here, which means that next is initialized as nextCONNECT or nextNonCONNECT.
In the case of nextCONNECT, an error is only returned here (n.b. badGateway returns the error unmodified), which means the original "i/o timeout" came from the dial.
In the case of nextNonCONNECT, an error is only returned here, which means that the original "i/o timeout" came from the RoundTrip call (and presumably a Read call on the underlying transport connection). In either case, the error appears to originate in the net package and should pass errors.As for a *net.OpError.
The proposal in this PR is to suppress these network timeout errors as they are out of our control and therefore just noise. I'm still logging them on DEBUG so that we can see them in proxy logs if we'd like.
Side-note: the filters mechanism makes tracing these kinds of things pretty onerous. I wonder if we can come up with something better.
The current top error in StackDriver is "i/o timeout": link.
The stack trace indicates that this is logged here, which means the source of the error is this call to the next filter. The
RecordOp
filter is only used by proxy code here, which means that the next filter would be thecleanheadersfilter
created on the next line. A quick inspection reveals that thecleanheadersfilter
does not generate errors of its own.Looking at the use of the filter chain, we can see that, at least for non-WSS proxies, the
cleanheadersfilter
is the last in the chain. So thenext
function returning the error must be provided by whoever callsApply
on the filter chain. As seen in the previous link, the filter chain is provided togetlantern/http-proxy/server.New
, where it is passed togetlantern/proxy.New
. There,Apply
is only ever called here, which means thatnext
is initialized as nextCONNECT or nextNonCONNECT.In the case of
nextCONNECT
, an error is only returned here (n.b.badGateway
returns the error unmodified), which means the original "i/o timeout" came from the dial.In the case of
nextNonCONNECT
, an error is only returned here, which means that the original "i/o timeout" came from theRoundTrip
call (and presumably aRead
call on the underlying transport connection). In either case, the error appears to originate in thenet
package and should passerrors.As
for a*net.OpError
.The proposal in this PR is to suppress these network timeout errors as they are out of our control and therefore just noise. I'm still logging them on DEBUG so that we can see them in proxy logs if we'd like.
Side-note: the filters mechanism makes tracing these kinds of things pretty onerous. I wonder if we can come up with something better.