-
Notifications
You must be signed in to change notification settings - Fork 17
Fix concurrency and silence period not being honoured #26
Fix concurrency and silence period not being honoured #26
Conversation
You mean |
But yeah... this would definitely help explain some bitswap reliability issues. |
True, we should fix that at the origin. In this case, the dup notification has no impact other than a warning log, but for pubsub it does. @vyzo just filed this today as well: libp2p/go-libp2p-pubsub#130, stemming from vacp2p/nim-libp2p#8
Agree. In general, bursty protocols trigger the worst case scenario. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for catching this! I'd like to consider the semantics of TrimOpenConns
a bit but that shouldn't block this fix.
I think that's a different issue. That is, we might have multiple connections for a single peer and will trigger a separate disconnect notification per connection. That's why I asked, I'm pretty sure we're not firing multiple disconnect notifications for a single connection. |
Yeah, the pubsub issue is that we have broken peer management -- it's not designed to handle multiple connections, and it breaks as soon as one of the connections is closed. |
Fixes #23. When connections are added while we're above the high watermark, we trigger multiple concurrent trims at once. This patch addresses these problems:
lastTrim
inside a lock; hence trims were allowed to proceed when they shouldn't have.