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

Upstream patch: defer bloomprocessor close #9

Merged
merged 2 commits into from
Sep 1, 2022

Conversation

0xe3b0c4
Copy link
Collaborator

@0xe3b0c4 0xe3b0c4 commented Aug 27, 2022

Description

From: #860

There's risk of memory leak for channel in bloomProcessors in Process when an early return happen.
Rationale

We need to ensure closing channel (bloomProcessors.Close()) before return

Changes

Notable changes:

user defer to make sure bloomProcessors.Close() be executed before Process return
keep current bloomProcessors.Close() for efficiency.

@0xe3b0c4 0xe3b0c4 changed the title Patch: Cherry pick BSC PR #860 Upstream patch: defer bloomprocessor close Aug 27, 2022
@0xe3b0c4 0xe3b0c4 added bug fix Fix a bug upstream pulling pull and merge from upstream repo labels Sep 1, 2022
Copy link
Collaborator

@RichardBrown123go RichardBrown123go left a comment

Choose a reason for hiding this comment

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

Thanks for this PR.
A little bit syntax update would make it more readable.

core/state_processor.go Outdated Show resolved Hide resolved
@RichardBrown123go RichardBrown123go merged commit daec18f into antimatter-dao:devel Sep 1, 2022
@0xe3b0c4 0xe3b0c4 deleted the cherry-pick-860 branch September 1, 2022 10:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug fix Fix a bug upstream pulling pull and merge from upstream repo
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants