From 1b442eb91b186904cb7925a9340484e8a245d357 Mon Sep 17 00:00:00 2001 From: Andrey Pechkurov Date: Tue, 13 Aug 2024 16:11:49 +0300 Subject: [PATCH] Fix broadcast --- sender_pool.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sender_pool.go b/sender_pool.go index 3252262..fdddfc9 100644 --- a/sender_pool.go +++ b/sender_pool.go @@ -197,6 +197,8 @@ func (p *LineSenderPool) free(ctx context.Context, ps *pooledSender) error { p.mu.Lock() defer p.mu.Unlock() + // Notify free sender waiters, if any + defer p.cond.Broadcast() if flushErr != nil { // Failed to flush, close and call it a day @@ -215,8 +217,6 @@ func (p *LineSenderPool) free(ctx context.Context, ps *pooledSender) error { } p.freeSenders = append(p.freeSenders, ps) - // Notify free sender waiters, if any - p.cond.Broadcast() return nil }