From d5aa567e9804f773c3f059cacedf97be5047d1da 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 bcdb3aff1..e71cc977a 100644 --- a/ees/elastic.go +++ b/ees/elastic.go @@ -160,12 +160,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.clnOpts) - eEe.Unlock() return }