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

p2p: fix recursive context leak #1827

Merged
merged 2 commits into from
Feb 21, 2023
Merged

p2p: fix recursive context leak #1827

merged 2 commits into from
Feb 21, 2023

Conversation

corverroos
Copy link
Contributor

Fixes recursive context wrapping that caused a memory leak.

category: bug
ticket: none

@codecov
Copy link

codecov bot commented Feb 21, 2023

Codecov Report

Base: 55.20% // Head: 54.99% // Decreases project coverage by -0.21% ⚠️

Coverage data is based on head (d355039) compared to base (b1101e7).
Patch coverage: 0.00% of modified lines in pull request are covered.

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     
Impacted Files Coverage Δ
p2p/relay.go 0.00% <0.00%> (ø)
core/qbft/qbft.go 73.73% <0.00%> (-10.09%) ⬇️
app/vmock.go 71.28% <0.00%> (-3.08%) ⬇️
app/app.go 61.35% <0.00%> (+0.64%) ⬆️
core/priority/prioritiser.go 59.43% <0.00%> (+0.94%) ⬆️

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.
📢 Do you have feedback about the report comment? Let us know in this issue.

}

log.Debug(ctx, "Refreshing relay circuit reservation")
relayConnGauge.WithLabelValues(name).Set(0)
Copy link
Contributor Author

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))
Copy link
Contributor Author

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

@corverroos corverroos added the merge when ready Indicates bulldozer bot may merge when all checks pass label Feb 21, 2023
@obol-bulldozer obol-bulldozer bot merged commit 35f0d6d into main Feb 21, 2023
@obol-bulldozer obol-bulldozer bot deleted the corver/fixctx branch February 21, 2023 12:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge when ready Indicates bulldozer bot may merge when all checks pass
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants