Skip to content

Enable collect garbage in peer manager#2464

Merged
kamilsa merged 1 commit intomasterfrom
fix/memleak
Jun 10, 2025
Merged

Enable collect garbage in peer manager#2464
kamilsa merged 1 commit intomasterfrom
fix/memleak

Conversation

@kamilsa
Copy link
Copy Markdown
Contributor

@kamilsa kamilsa commented Jun 10, 2025

Referenced issues

None

Description of the Change

We were not starting garbage collection for connections. This PR fixes that.

Possible Drawbacks

None

Checklist Before Opening a PR

Before you open a Pull Request (PR), please make sure you've completed the following steps and confirm by answering 'Yes' to each item:

  1. Code is formatted: Have you run your code through clang-format to ensure it adheres to the project's coding standards? Yes
  2. Code is documented: Have you added comments and documentation to your code according to the guidelines in the project's contributing guidelines? Yes
  3. Self-review: Have you reviewed your own code to ensure it is free of typos, syntax errors, logical errors, and unresolved TODOs or FIXME without linking to an issue? Yes
  4. Zombienet Tests: Have you ensured that the zombienet tests are passing? Zombienet is a network simulation and testing tool used in this project. It's important to ensure that these tests pass to maintain the stability and reliability of the project. Yes

@kamilsa kamilsa marked this pull request as ready for review June 10, 2025 11:49
@kamilsa kamilsa changed the title fix/memleak Enable collect garbage in peer manager Jun 10, 2025
@kamilsa kamilsa requested review from Copilot, iceseer and turuslan June 10, 2025 11:50
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR ensures that the peer manager begins its garbage collection process immediately after aligning peers.

  • Triggers garbage collection right after the initial align() call
  • Adds a comment indicating the start of the periodic collection timer
Comments suppressed due to low confidence (3)

core/network/impl/peer_manager_impl.cpp:228

  • The comment implies that a timer is started, but collectGarbage() may perform a single run. Consider updating the comment to accurately describe whether it triggers immediate cleanup or schedules recurring collection.
// Start timer for periodic collecting garbage

core/network/impl/peer_manager_impl.cpp:229

  • Add a unit or integration test to verify that invoking collectGarbage() at startup correctly schedules or performs the intended periodic cleanup.
collectGarbage();

core/network/impl/peer_manager_impl.cpp:229

  • [nitpick] If collectGarbage() internally schedules a periodic task, ensure its handle is stored or managed so you can cancel or prevent duplicate timers later.
collectGarbage();

@kamilsa kamilsa enabled auto-merge (squash) June 10, 2025 11:52
@kamilsa kamilsa disabled auto-merge June 10, 2025 11:52
@kamilsa kamilsa merged commit 7b05d0f into master Jun 10, 2025
20 of 26 checks passed
@kamilsa kamilsa deleted the fix/memleak branch June 10, 2025 13:03
kamilsa added a commit that referenced this pull request Jun 10, 2025
kamilsa added a commit that referenced this pull request Jun 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants