From 4bf19797f3b449032d16cd50ebe1f8a0bc2d6703 Mon Sep 17 00:00:00 2001 From: Martin Atkins Date: Fri, 24 Aug 2018 17:10:06 -0700 Subject: [PATCH] plugin: Fix deadlock in getSchema where mutex is never unlocked On the second call here this would fail to release the lock. --- plugin/grpc_provider.go | 1 + 1 file changed, 1 insertion(+) diff --git a/plugin/grpc_provider.go b/plugin/grpc_provider.go index 443226417..8c435395c 100644 --- a/plugin/grpc_provider.go +++ b/plugin/grpc_provider.go @@ -58,6 +58,7 @@ func (p *GRPCProvider) getSchema() providers.GetSchemaResponse { p.mu.Lock() // unlock inline in case GetSchema needs to be called if p.schemas.Provider.Block != nil { + p.mu.Unlock() return p.schemas } p.mu.Unlock()