You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 1, 2023. It is now read-only.
The reason for the allocation is that we set a timeout each time we send a message.
I believe we're getting so many of them because when we send a broadcast want or a cancel to thousands of peers we set a timeout for each one.
One idea that occurs to me is to keep a pool of contexts with timeout, where the timeouts are close to each other.
For example for a broadcast to peer A, peer B and peer C, the message timeout deadline will be roughly the same for all three. So before setting the timeout they check the pool to see if there's a context with timeout that falls within eg 10ms of the deadline they need.
As far as I can tell, we only need this context in some special cases (e.g., when calling Connect). We don't do that every time. Can we create a context on demand?
That's true we only need it when calling connect and when opening a stream, but that should only happen once per peer. So actually I think we can avoid using WithDeadline altogether for most calls to SendMsg()
The text was updated successfully, but these errors were encountered: