Incoming request ended abruptly as debug message

This commit is contained in:
Mads Jon Nielsen 2023-03-09 11:17:00 +01:00 committed by GitHub
parent bf3136debb
commit 0df4bb32d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 2 deletions

View File

@ -33,6 +33,10 @@ const (
trailerHeaderName = "Trailer" trailerHeaderName = "Trailer"
) )
var (
ErrRequestEndedAbruptly = errors.New("Incoming request ended abruptly")
)
// Proxy represents a means to Proxy between cloudflared and the origin services. // Proxy represents a means to Proxy between cloudflared and the origin services.
type Proxy struct { type Proxy struct {
ingressRules ingress.Ingress ingressRules ingress.Ingress
@ -123,7 +127,11 @@ func (p *Proxy) ProxyHTTP(
logFields, logFields,
); err != nil { ); err != nil {
rule, srv := ruleField(p.ingressRules, ruleNum) rule, srv := ruleField(p.ingressRules, ruleNum)
p.logRequestError(err, cfRay, "", rule, srv) if errors.Is(err, ErrRequestEndedAbruptly) {
p.log.Debug().Msg(err.Error())
} else {
p.logRequestError(err, cfRay, "", rule, srv)
}
return err return err
} }
return nil return nil
@ -225,7 +233,7 @@ func (p *Proxy) proxyHTTPRequest(
if err != nil { if err != nil {
tracing.EndWithErrorStatus(ttfbSpan, err) tracing.EndWithErrorStatus(ttfbSpan, err)
if err := roundTripReq.Context().Err(); err != nil { if err := roundTripReq.Context().Err(); err != nil {
return errors.Wrap(err, "Incoming request ended abruptly") return ErrRequestEndedAbruptly
} }
return errors.Wrap(err, "Unable to reach the origin service. The service may be down or it may not be responding to traffic from cloudflared") return errors.Wrap(err, "Unable to reach the origin service. The service may be down or it may not be responding to traffic from cloudflared")
} }