Skip to content

Commit

Permalink
fix(Cluster): ignore connection errors for subscriber.
Browse files Browse the repository at this point in the history
The errors will be caught by connection pool and a
new election will be made when the current subscriber
is lost, so we can safely ignore these errors.

Fix #768
  • Loading branch information
luin committed Jan 29, 2019
1 parent fbcf692 commit 84e46db
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/cluster/ClusterSubscriber.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ export default class ClusterSubscriber {
lazyConnect: true
})

// Ignore the errors since they're handled in the connection pool.
this.subscriber.on('error', noop)

// Re-subscribe previous channels
var previousChannels = { subscribe: [], psubscribe: [] }
if (lastActiveSubscriber) {
Expand Down

0 comments on commit 84e46db

Please sign in to comment.