From ac6a50ba12c83e66b4ad14f1bfa3c5f23f2cfb2d Mon Sep 17 00:00:00 2001 From: Robsdedude Date: Thu, 14 Dec 2023 13:11:12 +0100 Subject: [PATCH] Abort health check loop on done context (#555) Co-authored-by: Stephen Cathcart --- neo4j/internal/pool/server.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/neo4j/internal/pool/server.go b/neo4j/internal/pool/server.go index 070a442f..3b0b605a 100644 --- a/neo4j/internal/pool/server.go +++ b/neo4j/internal/pool/server.go @@ -76,14 +76,14 @@ func (s *server) healthCheck( if itime.Since(connection.IdleDate()) > idlenessTimeout { connection.ForceReset(ctx) if !connection.IsAlive() { - return false, nil + return false, ctx.Err() } } if err := connection.ReAuth(ctx, auth); err != nil { return false, err } if !connection.IsAlive() { - return false, nil + return false, ctx.Err() } // Update round-robin counter every time we give away a connection and keep track // of our own round-robin index