Remove invalid allocs

This commit is contained in:
Preetha Appan
2019-01-09 10:53:39 -06:00
parent 80919bf713
commit 5d7472fe82

View File

@@ -2013,7 +2013,13 @@ func (c *Client) removeAlloc(allocID string) {
ar, ok := c.allocs[allocID]
if !ok {
c.logger.Warn("cannot remove alloc", "alloc_id", allocID, "error", "alloc not found")
if _, ok := c.invalidAllocs[allocID]; ok {
// Removing from invalid allocs map if present
delete(c.invalidAllocs, allocID)
} else {
// Alloc is unknown, log a warning.
c.logger.Warn("cannot remove nonexistent alloc", "alloc_id", allocID, "error", "alloc not found")
}
return
}