From c740abafee52a62cf6f5ac60ada0f18080c002ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-No=C3=ABl=20Moyne?= Date: Mon, 9 Dec 2024 19:28:01 -0800 Subject: [PATCH] With the new changes to the max IPQ size on server v2.11 it is really easy to have some of the JS publish requests dropped when running nats bench using more than just a handfull of client connections. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This change just logs the error from a pub ack future and retries the publication instead of fatally stopping when this happens. Signed-off-by: Jean-Noël Moyne --- cli/bench_command.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cli/bench_command.go b/cli/bench_command.go index 8d019fde..ceecac34 100644 --- a/cli/bench_command.go +++ b/cli/bench_command.go @@ -845,7 +845,7 @@ func (c *benchCmd) jspubAction(_ *fisk.ParseContext) error { var err2 error for i := 0; i < c.numClients; i++ { if err := <-errChan; err != nil { - log.Printf("Error from client %d: %v", i, err) + log.Printf("Fatal error from client %d: %v", i, err) // only return the first error since only one error can be returned if err2 == nil { err2 = err @@ -1649,7 +1649,7 @@ func (c *benchCmd) jsPublisher(nc *nats.Conn, progress *uiprogress.Bar, msg []by case <-futures[future].Ok(): i++ case err := <-futures[future].Err(): - return fmt.Errorf("publish acknowledgement: %w", err) + fmt.Println(fmt.Errorf("publish acknowledgement is an error: %w (retrying)", err).Error()) } } case <-time.After(c.jsTimeout):