-
Notifications
You must be signed in to change notification settings - Fork 90
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
p2p: fix recursive context leak #1827
Conversation
Codecov ReportBase: 55.20% // Head: 54.99% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #1827 +/- ##
==========================================
- Coverage 55.20% 54.99% -0.21%
==========================================
Files 169 169
Lines 22140 22137 -3
==========================================
- Hits 12222 12174 -48
- Misses 8355 8396 +41
- Partials 1563 1567 +4
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
} | ||
|
||
log.Debug(ctx, "Refreshing relay circuit reservation") | ||
relayConnGauge.WithLabelValues(name).Set(0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clear gauge, this fixes issue of "previous relay getting stuck" in the metrics.
relayPeer, ok := relay.Peer() | ||
if !ok { | ||
time.Sleep(time.Second * 10) // Constant 10s backoff ok for mutexed lookups | ||
continue | ||
} | ||
|
||
name := PeerName(relayPeer.ID) | ||
ctx = log.WithCtx(ctx, z.Str("relay_peer", name)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
recursive wrapping cause the leak
Fixes recursive context wrapping that caused a memory leak.
category: bug
ticket: none