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

[Memory leak] Remove dangling pointers in the blockchain subscription #194

Merged
merged 3 commits into from
Sep 23, 2022

Conversation

DarianShawn
Copy link
Collaborator

Description

The blockchain subscription hold the whole update events and never release it, which made a memory leak.

This PR fixes it. It is merging from 0xPolygon Edge project PR 741.

Changes include

  • Bugfix (non-breaking change that solves an issue)
  • Hotfix (change that solves an urgent issue, and requires immediate attention)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (change that is not backwards-compatible and/or changes current functionality)

Checklist

  • I have assigned this PR to myself
  • I have added at least 1 reviewer
  • I have added the relevant labels
  • I have updated the official documentation
  • I have added sufficient documentation in code

Testing

  • I have tested this code with the official test suite
  • I have tested this code manually

@DarianShawn DarianShawn added the hotfix Major bug fix that should be merged ASAP label Sep 23, 2022
@DarianShawn DarianShawn added this to the Release 1.1.4 milestone Sep 23, 2022
@DarianShawn DarianShawn self-assigned this Sep 23, 2022
@DarianShawn DarianShawn changed the title Remove dangling pointers in the subscription struct [Memory leak] Remove dangling pointers in the blockchain subscription Sep 23, 2022
@codecov-commenter
Copy link

Codecov Report

Merging #194 (0dc4378) into dev (c648f03) will increase coverage by 0.01%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##              dev     #194      +/-   ##
==========================================
+ Coverage   51.37%   51.39%   +0.01%     
==========================================
  Files         114      114              
  Lines       16986    16962      -24     
==========================================
- Hits         8727     8718       -9     
+ Misses       7519     7504      -15     
  Partials      740      740              
Impacted Files Coverage Δ
blockchain/subscription.go 81.57% <100.00%> (+9.57%) ⬆️
protocol/sync_peer.go 70.00% <0.00%> (+1.00%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link

@0xcb9ff9 0xcb9ff9 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@DarianShawn DarianShawn merged commit 1225fcc into dev Sep 23, 2022
@DarianShawn DarianShawn deleted the fix/memory-leak-in-blockchain branch September 23, 2022 06:07
@github-actions github-actions bot locked and limited conversation to collaborators Sep 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
hotfix Major bug fix that should be merged ASAP
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants