Skip to content

Commit

Permalink
move logs to debug level to mitigate lock contention
Browse files Browse the repository at this point in the history
  • Loading branch information
psFried committed Apr 9, 2024
1 parent f9c200a commit 164b458
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions proxy/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func (h *ProxyHandler) proxyHttp(ctx context.Context, clientConn *tls.Conn, prox
"shardID": proxyConn.shardID,
"error": err,
"URI": req.RequestURI,
}).Error("proxy error")
}).Debug("proxy error")
handleHttpError(err, w, req)
},

Expand Down Expand Up @@ -229,7 +229,7 @@ func handleHttpError(err error, w http.ResponseWriter, r *http.Request) {
log.WithFields(log.Fields{
"origError": err.Error(),
"templateError": writeErr.Error(),
}).Warn("failed to write error response body")
}).Debug("failed to write error response body")
}
}

Expand Down
12 changes: 6 additions & 6 deletions proxy/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ func (ps *ProxyServer) Run() error {
log.WithFields(log.Fields{
"error": hsErr,
"clientAddr": conn.RemoteAddr(),
}).Info("tls handshake error")
}).Debug("tls handshake error")
return
}
var state = conn.(*tls.Conn).ConnectionState()
Expand Down Expand Up @@ -471,15 +471,15 @@ func (h *ProxyHandler) handleProxyConnection(ctx context.Context, conn *tls.Conn
"clientAddr": clientAddr,
"proto": state.NegotiatedProtocol,
"shard": shardID,
}).Warn("failed to proxy connection")
}).Debug("failed to proxy connection")
} else {
ProxyConnectionsClosedCounter.WithLabelValues(shardID, portStr, "ok").Inc()
log.WithFields(log.Fields{
"sni": sni,
"clientAddr": clientAddr,
"proto": state.NegotiatedProtocol,
"shard": shardID,
}).Info("finished proxy connection")
}).Debug("finished proxy connection")
}
}

Expand Down Expand Up @@ -540,7 +540,7 @@ func (h *ProxyHandler) proxyConnection(ctx context.Context, conn *tls.Conn, sni
"clientAddr": clientAddr,
"reactorAddr": reactorAddr,
"proto": negotiatedProto,
}).Info("starting to proxy connection data")
}).Debug("starting to proxy connection data")

// We're finally ready to copy the data between the connection and our grpc streaming rpc.
if isHttp(negotiatedProto) {
Expand All @@ -560,7 +560,7 @@ func proxyTcp(ctx context.Context, clientConn *tls.Conn, proxyConn *ProxyConnect
"hostname": proxyConn.hostname,
"error": e,
"outgoingBytes": outgoingBytes,
}).Warn("copyProxyResponseData completed with error")
}).Debug("copyProxyResponseData completed with error")
return e
} else {
log.WithFields(log.Fields{
Expand All @@ -579,7 +579,7 @@ func proxyTcp(ctx context.Context, clientConn *tls.Conn, proxyConn *ProxyConnect
"hostname": proxyConn.hostname,
"error": e,
"incomingBytes": incomingBytes,
}).Warn("copyProxyRequestData completed with error")
}).Debug("copyProxyRequestData completed with error")
return e
} else {
log.WithFields(log.Fields{
Expand Down

0 comments on commit 164b458

Please sign in to comment.