Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

move logs to debug level to mitigate lock contention #43

Merged
merged 1 commit into from
Apr 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading