-
Notifications
You must be signed in to change notification settings - Fork 109
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
bitswap: long-running session leaks #752
Comments
I will create separate PR for each of these and review and merge these into our code base, unless you would rather do this from your fork. We are also resolving memory consumption issues with connections, so it would be great to get all the known memory issues handled in at the same time. So let me know soon. Thank you. |
The first two fixes appear to be incorrect according to the comment in
@Wondertan Please let me know if this needs further investigation. |
Oops, seems like we needed more information for this issue, please comment with more details or this issue will be closed in 7 days. |
Hey @gammazero, thank you for submitting the fixes.
Re above. The first commit cleans up the |
6cd1ed9 goes further and cleans up |
And 70a6503 is pretty severe bug independently of long-running sessions. Check the comment there for description. Besides, one could blow up a peer by sending presences of completely arbitrary CIDs, because Bitswap never checks if those CIDs presences are even relevant(in |
@gammazero, gentle ping here |
Concerning 6cd1ed9, I agree with @gammazero, removing the cids from the interest list, rather than just the want list would have side effects. boxo/bitswap/client/internal/sessioninterestmanager/sessioninterestmanager.go Lines 119 to 142 in 3aa3bee
This function computes the intersection between the provided cids, and the interest list, not the want list. So removing cids from the interest list instead of the want list would have undesired side effects IIUC. boxo/bitswap/client/internal/sessioninterestmanager/sessioninterestmanager.go Lines 178 to 202 in 3aa3bee
This function lists all the sessions that are interested in this block. Hence, he the session doesn't WANT the block but is INTERESTED in it, the session id should be returned. IIUC it is a feature that the cids remain in the interest list as long as the session is alive. So changing this would modify the Bitswap client behaviour. |
@guillaumemichel, can you give an example of a side-effect? I couldn't find of one, but maybe there is |
@Wondertan see #821 |
With #833, all mentioned leaks should be addressed @Wondertan. Closing this issue, feel free to reopen if something is missing. |
We've been running long-running Bitswap sessions and encountered a series of memory leaks that we've successfully identified and fixed in our fork. I plan to start upstreaming them eventually, but I am currently botted with millions of things. Anyway, I want to make you aware of their existence already in case you have the capacity to look into those.
The full branch is located here. Some of them were merged, some of them aren't. The most notable are:
All of those fixes have been tested on hundreds of nodes in production, and things have been running smoothly and steadily for 3 weeks. I am happy to answer if you start working on this sooner than when I get to opening PRs myself.
cc @hsanjuan, @gammazero, @lidel
The text was updated successfully, but these errors were encountered: