From 1cdeac003efb114901bbd671502591cc2675e185 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 19 Jul 2022 11:14:04 +0200 Subject: [PATCH] Bump github.com/libp2p/go-libp2p-pubsub from 0.7.0 to 0.7.1 (#620) Bumps [github.com/libp2p/go-libp2p-pubsub](https://github.com/libp2p/go-libp2p-pubsub) from 0.7.0 to 0.7.1. - [Release notes](https://github.com/libp2p/go-libp2p-pubsub/releases) - [Commits](https://github.com/libp2p/go-libp2p-pubsub/compare/v0.7.0...v0.7.1) --- updated-dependencies: - dependency-name: github.com/libp2p/go-libp2p-pubsub dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- .../libp2p/go-libp2p-pubsub/pubsub.go | 23 +++++++++---------- vendor/modules.txt | 2 +- 4 files changed, 15 insertions(+), 16 deletions(-) diff --git a/go.mod b/go.mod index 03860e973c..bc86391813 100644 --- a/go.mod +++ b/go.mod @@ -19,7 +19,7 @@ require ( github.com/libp2p/go-libp2p v0.20.0 github.com/libp2p/go-libp2p-core v0.17.0 github.com/libp2p/go-libp2p-kbucket v0.4.7 - github.com/libp2p/go-libp2p-pubsub v0.7.0 + github.com/libp2p/go-libp2p-pubsub v0.7.1 github.com/miekg/dns v1.1.49 // indirect github.com/multiformats/go-base32 v0.0.4 // indirect github.com/multiformats/go-multiaddr v0.6.0 diff --git a/go.sum b/go.sum index d520c83478..84578e4800 100644 --- a/go.sum +++ b/go.sum @@ -703,8 +703,8 @@ github.com/libp2p/go-libp2p-peerstore v0.6.0/go.mod h1:DGEmKdXrcYpK9Jha3sS7MhqYd github.com/libp2p/go-libp2p-peerstore v0.7.0 h1:2iIUwok3vtmnWJTZeTeLgnBO6GbkXcwSRwgZHEKrQZs= github.com/libp2p/go-libp2p-peerstore v0.7.0/go.mod h1:cdUWTHro83vpg6unCpGUr8qJoX3e93Vy8o97u5ppIM0= github.com/libp2p/go-libp2p-pnet v0.2.0/go.mod h1:Qqvq6JH/oMZGwqs3N1Fqhv8NVhrdYcO0BW4wssv21LA= -github.com/libp2p/go-libp2p-pubsub v0.7.0 h1:Fd9198JVc3pCsKuzd37TclzM0QcHA+uDyoiG2pvT7s4= -github.com/libp2p/go-libp2p-pubsub v0.7.0/go.mod h1:EuyBJFtF8qF67IEA98biwK8Xnw5MNJpJ/Z+8iWCMFwc= +github.com/libp2p/go-libp2p-pubsub v0.7.1 h1:e2CPBP5uxvDkE0FiS0obZGZPzt+xuBOc6PpG+50pIAo= +github.com/libp2p/go-libp2p-pubsub v0.7.1/go.mod h1:EuyBJFtF8qF67IEA98biwK8Xnw5MNJpJ/Z+8iWCMFwc= github.com/libp2p/go-libp2p-quic-transport v0.13.0/go.mod h1:39/ZWJ1TW/jx1iFkKzzUg00W6tDJh73FC0xYudjr7Hc= github.com/libp2p/go-libp2p-quic-transport v0.16.0/go.mod h1:1BXjVMzr+w7EkPfiHkKnwsWjPjtfaNT0q8RS3tGDvEQ= github.com/libp2p/go-libp2p-quic-transport v0.16.1/go.mod h1:1BXjVMzr+w7EkPfiHkKnwsWjPjtfaNT0q8RS3tGDvEQ= diff --git a/vendor/github.com/libp2p/go-libp2p-pubsub/pubsub.go b/vendor/github.com/libp2p/go-libp2p-pubsub/pubsub.go index 98ebb34bf2..85df995e4c 100644 --- a/vendor/github.com/libp2p/go-libp2p-pubsub/pubsub.go +++ b/vendor/github.com/libp2p/go-libp2p-pubsub/pubsub.go @@ -695,6 +695,16 @@ func (p *PubSub) handleDeadPeers() { } close(ch) + delete(p.peers, pid) + + for t, tmap := range p.topics { + if _, ok := tmap[pid]; ok { + delete(tmap, pid) + p.notifyLeave(t, pid) + } + } + + p.rt.RemovePeer(pid) if p.host.Network().Connectedness(pid) == network.Connected { backoffDelay, err := p.deadPeerBackoff.updateAndGet(pid) @@ -708,20 +718,9 @@ func (p *PubSub) handleDeadPeers() { log.Debugf("peer declared dead but still connected; respawning writer: %s", pid) messages := make(chan *RPC, p.peerOutboundQueueSize) messages <- p.getHelloPacket() - go p.handleNewPeerWithBackoff(p.ctx, pid, backoffDelay, messages) p.peers[pid] = messages - continue - } - - delete(p.peers, pid) - for t, tmap := range p.topics { - if _, ok := tmap[pid]; ok { - delete(tmap, pid) - p.notifyLeave(t, pid) - } + go p.handleNewPeerWithBackoff(p.ctx, pid, backoffDelay, messages) } - - p.rt.RemovePeer(pid) } } diff --git a/vendor/modules.txt b/vendor/modules.txt index fef77ce9d4..67a1c572cb 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -424,7 +424,7 @@ github.com/libp2p/go-libp2p-kbucket/peerdiversity ## explicit; go 1.17 github.com/libp2p/go-libp2p-peerstore github.com/libp2p/go-libp2p-peerstore/pstoremem -# github.com/libp2p/go-libp2p-pubsub v0.7.0 +# github.com/libp2p/go-libp2p-pubsub v0.7.1 ## explicit; go 1.13 github.com/libp2p/go-libp2p-pubsub github.com/libp2p/go-libp2p-pubsub/pb