Skip to content

Commit

Permalink
fix relayer queue full error
Browse files Browse the repository at this point in the history
  • Loading branch information
cedricfung committed May 22, 2024
1 parent 292bf7a commit 15fb5b1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion kernel/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ func (node *Node) ReadSnapshotsForNodeRound(nodeIdWithNetwork crypto.Hash, round
}

func (node *Node) sendGraphToConcensusNodesAndPeers() {
graphTicker := time.NewTicker(time.Duration(config.SnapshotRoundGap))
graphTicker := time.NewTicker(time.Duration(config.SnapshotRoundGap / 2))
defer graphTicker.Stop()

for {
Expand Down
8 changes: 4 additions & 4 deletions p2p/peer.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ func (me *Peer) loopSendingStream(p *Peer, consumer Client) (*ChanMsg, error) {
for len(msgs) < 16 {
item, err := p.highRing.Poll(false)
if err != nil {
return nil, err
return nil, fmt.Errorf("peer.highRing(%s) => %v", p.IdForNetwork, err)
} else if item == nil {
break
}
Expand All @@ -259,7 +259,7 @@ func (me *Peer) loopSendingStream(p *Peer, consumer Client) (*ChanMsg, error) {
for len(msgs) < 32 {
item, err := p.normalRing.Poll(false)
if err != nil {
return nil, err
return nil, fmt.Errorf("peer.normalRing(%s) => %v", p.IdForNetwork, err)
} else if item == nil {
break
}
Expand All @@ -271,7 +271,7 @@ func (me *Peer) loopSendingStream(p *Peer, consumer Client) (*ChanMsg, error) {
}

if len(msgs) == 0 {
time.Sleep(time.Second)
time.Sleep(300 * time.Millisecond)
continue
}

Expand Down Expand Up @@ -431,7 +431,7 @@ func (me *Peer) sendToPeer(to crypto.Hash, typ byte, key, data []byte, priority
if success {
break
}
return fmt.Errorf("peer.offer(%s, %s) => %d timeout", peer.Address, peer.IdForNetwork, priority)
logger.Printf("peer.offer(%s, %s) => %d timeout", peer.Address, peer.IdForNetwork, priority)
}
return nil
}
Expand Down

0 comments on commit 15fb5b1

Please sign in to comment.