From 5bd439020c5b31ea7d8bbb16debd5d21efa9dc12 Mon Sep 17 00:00:00 2001 From: ionutboangiu Date: Fri, 15 Nov 2024 18:50:38 +0200 Subject: [PATCH] Prevent deadlock inside *els Connect --- ees/elastic.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ees/elastic.go b/ees/elastic.go index 7a01e25a2..8aa845c7f 100644 --- a/ees/elastic.go +++ b/ees/elastic.go @@ -161,12 +161,12 @@ func (eEe *ElasticEE) Cfg() *config.EventExporterCfg { return eEe.cfg } func (eEe *ElasticEE) Connect() (err error) { eEe.Lock() + defer eEe.Unlock() // create the client if eEe.eClnt != nil { return } eEe.eClnt, err = elasticsearch.NewClient(eEe.clntOpts) - eEe.Unlock() return }