From c369c1989f541ac0e7c76d5c7610de0cf5f940ee Mon Sep 17 00:00:00 2001 From: Pontus Rydin Date: Thu, 27 Sep 2018 20:29:17 -0400 Subject: [PATCH] Fix panic during network error in vsphere input (#4765) --- plugins/inputs/vsphere/endpoint.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/inputs/vsphere/endpoint.go b/plugins/inputs/vsphere/endpoint.go index cad4dec00a1b1..22b479a5c7fee 100644 --- a/plugins/inputs/vsphere/endpoint.go +++ b/plugins/inputs/vsphere/endpoint.go @@ -661,7 +661,7 @@ func (e *Endpoint) collectResource(ctx context.Context, resourceType string, acc err := make(multiError, 0) wp.Drain(ctx, func(ctx context.Context, in interface{}) bool { if in != nil { - mux.Unlock() + mux.Lock() defer mux.Unlock() err = append(err, in.(error)) return false