Skip to content

Commit

Permalink
Merge pull request #24 from PowerLoom/chore/fatal-exit-conn-lost
Browse files Browse the repository at this point in the history
feat: fatal exit upon loss of connection to sequencer
  • Loading branch information
anomit authored Dec 3, 2024
2 parents 0421555 + e3f73d8 commit 5cbdac2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 21 deletions.
6 changes: 4 additions & 2 deletions pkgs/service/libp2p_stream_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,11 +171,13 @@ func (p *StreamPool) createNewStreamWithRetry() (network.Stream, error) {
// Get current connection state
hostConn, seqId, err := GetSequencerConnection()
if err != nil {
return fmt.Errorf("cannot create stream: %w", err)
log.Fatal("Lost connection to sequencer - terminating service for restart")
return fmt.Errorf("fatal: sequencer connection lost")
}

if hostConn.Network().Connectedness(seqId) != network.Connected {
return fmt.Errorf("connection to sequencer lost")
log.Fatal("Lost connection to sequencer - terminating service for restart")
return fmt.Errorf("fatal: connection to sequencer lost")
}

stream, err = p.createStream()
Expand Down
19 changes: 0 additions & 19 deletions pm2.config.js

This file was deleted.

0 comments on commit 5cbdac2

Please sign in to comment.