Skip to content

fix: close handshake datachannel after use #3076

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

Merged
merged 17 commits into from
Apr 15, 2025

Conversation

achingbrain
Copy link
Member

Some times the handshake datachannel can remain open which causes a memory leak and stops the process from exiting so explicitly close the channel after the noise handshake has completed.

Also removes a redundant raceSignal - it's not necessary as we pass the signal in to the connect method.

Fixes #2625

Change checklist

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation if necessary (this includes comments as well)
  • I have added tests that prove my fix is effective or that my feature works

Some times the handshake datachannel can remain open which causes
a memory leak and stops the process from exiting so explicitly
close the channel after the noise handshake has completed.

Also removes a redundant `raceSignal` - it's not necessary as we
pass the signal in to the `connect` method.
@achingbrain achingbrain requested a review from a team as a code owner April 10, 2025 16:51
@achingbrain achingbrain merged commit b9e32cc into main Apr 15, 2025
31 of 32 checks passed
@achingbrain achingbrain deleted the fix/close-handshake-datachannel-after-use branch April 15, 2025 12:36
@achingbrain
Copy link
Member Author

Refs: ipshipyard/roadmaps#22

@achingbrain achingbrain added the kind/bug A bug in existing code (including security flaws) label Apr 15, 2025
achingbrain added a commit that referenced this pull request Apr 16, 2025
Removes the closing of the handshake datachannel after the connection
has been opened because it breaks compatibility with rust-libp2p 53.

This can be revisited after libp2p/rust-libp2p#5986
is resolved.
achingbrain added a commit that referenced this pull request Apr 16, 2025
Removes the closing of the handshake datachannel after the connection
has been opened because it breaks compatibility with rust-libp2p 53.

This can be revisited after libp2p/rust-libp2p#5986
is resolved.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug A bug in existing code (including security flaws)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

.stop() sometimes hangs indefinitely
1 participant