add debug panic

This commit is contained in:
Alex Dadgar
2016-11-29 15:57:40 -08:00
parent e01e02e7cf
commit 026802b7bc

View File

@@ -1723,6 +1723,10 @@ func (c *Client) addAlloc(alloc *structs.Allocation, prevAllocDir *allocdir.Allo
// Store the alloc runner.
c.allocLock.Lock()
if _, ok := c.allocs[alloc.ID]; ok {
c.allocLock.Unlock()
panic(fmt.Sprintf("Alloc Runner already exists for alloc %q", alloc.ID))
}
c.allocs[alloc.ID] = ar
c.allocLock.Unlock()
return nil