Skip to content
This repository was archived by the owner on Aug 29, 2023. It is now read-only.

fix: if ending socket with error, destroy it in the end #202

Closed
wants to merge 2 commits into from

Conversation

twoeths
Copy link
Contributor

@twoeths twoeths commented Aug 30, 2022

Motivation

  • There are a lot of sockets retained, see Sockets leak #201
  • When ending a socket with error, we clear the timer which make it unable to destroy the socket in the end

Screen Shot 2022-08-30 at 13 47 45

**Description

  • When ending socket and error happen, keep the timer so that socket is destroyed in the end

@achingbrain
Copy link
Member

I think with this change, if the socket is closed with an error, maConn.timeline.close will now not be set.

@wemeetagain
Copy link
Member

@tuyennhv we discussed this during js-libp2p triage meeting, @achingbrain is working on an alternative fix. Will close this PR once his PR is open / merged.

@twoeths
Copy link
Contributor Author

twoeths commented Aug 31, 2022

This solution works well so far (it's deployed around Aug 30 12:00), waiting for the new PR by @achingbrain

Screen Shot 2022-08-31 at 08 24 52

@twoeths twoeths closed this Aug 31, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants