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

fix: create logger once instead of every iteration #10544

Merged
merged 1 commit into from
Jan 2, 2025
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
5 changes: 5 additions & 0 deletions changelog/v1.19.0-beta3/memleak.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
changelog:
- type: FIX
issueLink: https://github.com/solo-io/solo-projects/issues/7573
description: >-
Fix a memory leaking a log name.
6 changes: 3 additions & 3 deletions projects/gloo/pkg/syncer/setup/setup_syncer.go
Original file line number Diff line number Diff line change
Expand Up @@ -1375,15 +1375,15 @@ func runQueue(ctx context.Context, proxyReconcileQueue ggv2utils.AsyncQueue[gloo
// the proxy type key/value must stay in sync with the one defined in projects/gateway2/translator/gateway_translator.go
utils.ProxyTypeKey: utils.GatewayApiProxyValue,
}
ctx = contextutils.WithLogger(ctx, "proxyCache")
logger := contextutils.LoggerFrom(ctx)

proxyReconciler := gloov1.NewProxyReconciler(proxyClient, statusutils.NewNoOpStatusClient())
for {
proxyList, err := proxyReconcileQueue.Dequeue(ctx)
if err != nil {
return
}
ctx = contextutils.WithLogger(ctx, "proxyCache")
logger := contextutils.LoggerFrom(ctx)

// Proxy CR is located in the writeNamespace, which may be different from the originating Gateway CR
err = proxyReconciler.Reconcile(
writeNamespace,
Expand Down
Loading