From f7520e13f38ec22a74a55e62bc8a49952b44fab9 Mon Sep 17 00:00:00 2001 From: Rob Landers Date: Fri, 17 May 2024 09:25:47 +0200 Subject: [PATCH] Pause heartbeat detection during reconnection --- jetstream/pull.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/jetstream/pull.go b/jetstream/pull.go index 3196ad519..474177163 100644 --- a/jetstream/pull.go +++ b/jetstream/pull.go @@ -596,6 +596,12 @@ func (s *pullSubscription) Next() (Msg, error) { if errors.Is(err, errConnected) { if !isConnected { isConnected = true + + if hbMonitor != nil { + // we are not going to get a heartbeat while reconnecting + hbMonitor.Stop() + } + // try fetching consumer info several times to make sure consumer is available after reconnect backoffOpts := backoffOpts{ attempts: 10,