-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Don't allocate a new buffer pool per connection. #4397
Comments
On further inspection, it we may have been sharing some buffer pools in some cases as some packages copied the buffer pools while others referenced them (which would have initialized the inner buffer pools). Regardless, this behavior was buggy as hell, prone to deadlocks (copying initialized locks...), and inefficient. |
I think this should be fixed by changing https:/libp2p/go-msgio/blob/master/mpool/pool.go#L29 to be a pointer to a This way simple re-referencing would not copy the locks. |
This is actually fixed in master, I just stopped copying around the pool. However, yes, storing this as a reference would probably be a good idea and would prevent things like this from coming up in the future. |
It looks like we were doing this in secio.
Secio PR: libp2p/go-libp2p-secio#21
Related, pull through the updated go-msgio/mpool. It no longer uses a global lock...
The text was updated successfully, but these errors were encountered: