plugin: Fix deadlock in getSchema where mutex is never unlocked

On the second call here this would fail to release the lock.
This commit is contained in:
Martin Atkins 2018-08-24 17:10:06 -07:00
parent 5559d21855
commit 4bf19797f3
1 changed files with 1 additions and 0 deletions

View File

@ -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()