Skip to content

Commit

Permalink
feat: fatal exit upon loss of connection to sequencer
Browse files Browse the repository at this point in the history
  • Loading branch information
anomit committed Nov 18, 2024
1 parent 28bae07 commit e3f73d8
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 e3f73d8

Please sign in to comment.