From bb4dec603256e9e77a2ed5b599c41ff647214546 Mon Sep 17 00:00:00 2001 From: Bruno Miguel Custodio Date: Fri, 8 Sep 2017 16:22:14 +0100 Subject: [PATCH] Make sure we don't relock. --- backend/remote-state/etcdv3/client.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/backend/remote-state/etcdv3/client.go b/backend/remote-state/etcdv3/client.go index 4cb1363ddf..fbc20d929d 100644 --- a/backend/remote-state/etcdv3/client.go +++ b/backend/remote-state/etcdv3/client.go @@ -100,6 +100,9 @@ func (c *RemoteClient) Lock(info *state.LockInfo) (string, error) { if !c.DoLock { return "", nil } + if c.etcdSession != nil { + return "", fmt.Errorf("state %q already locked", c.Key) + } c.info = info return c.lock()