Browse Source

reactors: skip log on some routine cancels (#7556)

pull/7555/head
Sam Kleinman 3 years ago
committed by GitHub
parent
commit
5bf1bdcfb4
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 0 additions and 26 deletions
  1. +0
    -1
      cmd/priv_val_server/main.go
  2. +0
    -1
      internal/blocksync/reactor.go
  3. +0
    -1
      internal/consensus/reactor.go
  4. +0
    -2
      internal/consensus/ticker.go
  5. +0
    -1
      internal/evidence/reactor.go
  6. +0
    -1
      internal/mempool/reactor.go
  7. +0
    -5
      internal/p2p/conn/connection.go
  8. +0
    -2
      internal/p2p/pex/reactor.go
  9. +0
    -9
      internal/p2p/router.go
  10. +0
    -1
      internal/statesync/reactor.go
  11. +0
    -2
      rpc/jsonrpc/client/ws_client.go

+ 0
- 1
cmd/priv_val_server/main.go View File

@ -138,7 +138,6 @@ func main() {
defer opcancel()
go func() {
<-opctx.Done()
logger.Debug("SignerServer: calling Close")
if *prometheusAddr != "" {
ctx, cancel := context.WithTimeout(context.Background(), 1*time.Second)
defer cancel()


+ 0
- 1
internal/blocksync/reactor.go View File

@ -354,7 +354,6 @@ func (r *Reactor) processPeerUpdates(ctx context.Context) {
for {
select {
case <-ctx.Done():
r.logger.Debug("stopped listening on peer updates channel; closing...")
return
case peerUpdate := <-r.peerUpdates.Updates():
r.processPeerUpdate(peerUpdate)


+ 0
- 1
internal/consensus/reactor.go View File

@ -1455,7 +1455,6 @@ func (r *Reactor) processPeerUpdates(ctx context.Context) {
for {
select {
case <-ctx.Done():
r.logger.Debug("stopped listening on peer updates channel; closing...")
return
case peerUpdate := <-r.peerUpdates.Updates():
r.processPeerUpdate(ctx, peerUpdate)


+ 0
- 2
internal/consensus/ticker.go View File

@ -81,7 +81,6 @@ func (t *timeoutTicker) stopTimer() {
select {
case <-t.timer.C:
default:
t.logger.Debug("Timer already stopped")
}
}
}
@ -90,7 +89,6 @@ func (t *timeoutTicker) stopTimer() {
// timers are interupted and replaced by new ticks from later steps
// timeouts of 0 on the tickChan will be immediately relayed to the tockChan
func (t *timeoutTicker) timeoutRoutine(ctx context.Context) {
t.logger.Debug("Starting timeout routine")
var ti timeoutInfo
for {
select {


+ 0
- 1
internal/evidence/reactor.go View File

@ -255,7 +255,6 @@ func (r *Reactor) processPeerUpdates(ctx context.Context) {
case peerUpdate := <-r.peerUpdates.Updates():
r.processPeerUpdate(ctx, peerUpdate)
case <-ctx.Done():
r.logger.Debug("stopped listening on peer updates channel; closing...")
return
}
}


+ 0
- 1
internal/mempool/reactor.go View File

@ -281,7 +281,6 @@ func (r *Reactor) processPeerUpdates(ctx context.Context) {
for {
select {
case <-ctx.Done():
r.logger.Debug("stopped listening on peer updates channel; closing...")
return
case peerUpdate := <-r.peerUpdates.Updates():
r.processPeerUpdate(ctx, peerUpdate)


+ 0
- 5
internal/p2p/conn/connection.go View File

@ -353,7 +353,6 @@ FOR_LOOP:
channel.updateStats()
}
case <-c.pingTimer.C:
c.logger.Debug("Send Ping")
_n, err = protoWriter.WriteMsg(mustWrapPacket(&tmp2p.PacketPing{}))
if err != nil {
c.logger.Error("Failed to send PacketPing", "err", err)
@ -370,13 +369,11 @@ FOR_LOOP:
c.flush()
case timeout := <-c.pongTimeoutCh:
if timeout {
c.logger.Debug("Pong timeout")
err = errors.New("pong timeout")
} else {
c.stopPongTimer()
}
case <-c.pong:
c.logger.Debug("Send Pong")
_n, err = protoWriter.WriteMsg(mustWrapPacket(&tmp2p.PacketPong{}))
if err != nil {
c.logger.Error("Failed to send PacketPong", "err", err)
@ -528,14 +525,12 @@ FOR_LOOP:
case *tmp2p.Packet_PacketPing:
// TODO: prevent abuse, as they cause flush()'s.
// https://github.com/tendermint/tendermint/issues/1190
c.logger.Debug("Receive Ping")
select {
case c.pong <- struct{}{}:
default:
// never block
}
case *tmp2p.Packet_PacketPong:
c.logger.Debug("Receive Pong")
select {
case c.pongTimeoutCh <- false:
default:


+ 0
- 2
internal/p2p/pex/reactor.go View File

@ -181,7 +181,6 @@ func (r *Reactor) processPexCh(ctx context.Context) {
select {
case <-ctx.Done():
r.logger.Debug("stopped listening on PEX channel; closing...")
return
// outbound requests for new peers
@ -215,7 +214,6 @@ func (r *Reactor) processPeerUpdates(ctx context.Context) {
for {
select {
case <-ctx.Done():
r.logger.Debug("stopped listening on peer updates channel; closing...")
return
case peerUpdate := <-r.peerUpdates.Updates():
r.processPeerUpdate(peerUpdate)


+ 0
- 9
internal/p2p/router.go View File

@ -472,8 +472,6 @@ func (r *Router) dialSleep(ctx context.Context) {
// acceptPeers accepts inbound connections from peers on the given transport,
// and spawns goroutines that route messages to/from them.
func (r *Router) acceptPeers(ctx context.Context, transport Transport) {
r.logger.Debug("starting accept routine", "transport", transport)
for {
conn, err := transport.Accept(ctx)
switch err {
@ -555,8 +553,6 @@ func (r *Router) openConnection(ctx context.Context, conn Connection) {
// dialPeers maintains outbound connections to peers by dialing them.
func (r *Router) dialPeers(ctx context.Context) {
r.logger.Debug("starting dial routine")
addresses := make(chan NodeAddress)
wg := &sync.WaitGroup{}
@ -587,7 +583,6 @@ LOOP:
address, err := r.peerManager.DialNext(ctx)
switch {
case errors.Is(err, context.Canceled):
r.logger.Debug("stopping dial routine")
break LOOP
case err != nil:
r.logger.Error("failed to find next peer to dial", "err", err)
@ -917,16 +912,12 @@ func (r *Router) sendPeer(ctx context.Context, peerID types.NodeID, conn Connect
// evictPeers evicts connected peers as requested by the peer manager.
func (r *Router) evictPeers(ctx context.Context) {
r.logger.Debug("starting evict routine")
for {
peerID, err := r.peerManager.EvictNext(ctx)
switch {
case errors.Is(err, context.Canceled):
r.logger.Debug("stopping evict routine")
return
case err != nil:
r.logger.Error("failed to find next peer to evict", "err", err)
return


+ 0
- 1
internal/statesync/reactor.go View File

@ -887,7 +887,6 @@ func (r *Reactor) processPeerUpdates(ctx context.Context) {
for {
select {
case <-ctx.Done():
r.logger.Debug("stopped listening on peer updates channel; closing...")
return
case peerUpdate := <-r.peerUpdates.Updates():
r.processPeerUpdate(ctx, peerUpdate)


+ 0
- 2
rpc/jsonrpc/client/ws_client.go View File

@ -411,7 +411,6 @@ func (c *WSClient) writeRoutine(ctx context.Context) {
c.mtx.Lock()
c.sentLastPingAt = time.Now()
c.mtx.Unlock()
c.Logger.Debug("sent ping")
case <-c.readRoutineQuit:
return
case <-ctx.Done():
@ -445,7 +444,6 @@ func (c *WSClient) readRoutine(ctx context.Context) {
c.mtx.RUnlock()
c.PingPongLatencyTimer.UpdateSince(t)
c.Logger.Debug("got pong")
return nil
})


Loading…
Cancel
Save