diff --git a/CHANGELOG.md b/CHANGELOG.md index 980c0c500..5f39c64b9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,7 @@ BUG FIXES: * core: nicer error message if an encrypted private key is used for SSH. [GH-1445] + * core: Fix crash that could happen with a well timed double Ctrl-C. [GH-1328] * builder/amazon-chroot: Can properly build HVM images now. [GH-1360] * builder/amazon-chroot: Fix crash in root device check. [GH-1360] * builder/amazon-instance: Fix deprecation warning for `ec2-bundle-vol` diff --git a/packer/rpc/cache.go b/packer/rpc/cache.go index 184286411..a4539ae66 100644 --- a/packer/rpc/cache.go +++ b/packer/rpc/cache.go @@ -2,6 +2,7 @@ package rpc import ( "github.com/mitchellh/packer/packer" + "log" "net/rpc" ) @@ -24,7 +25,8 @@ type CacheRLockResponse struct { func (c *cache) Lock(key string) (result string) { if err := c.client.Call("Cache.Lock", key, &result); err != nil { - panic(err) + log.Printf("[ERR] Cache.Lock error: %s", err) + return } return @@ -33,7 +35,8 @@ func (c *cache) Lock(key string) (result string) { func (c *cache) RLock(key string) (string, bool) { var result CacheRLockResponse if err := c.client.Call("Cache.RLock", key, &result); err != nil { - panic(err) + log.Printf("[ERR] Cache.RLock error: %s", err) + return "", false } return result.Path, result.Exists @@ -41,13 +44,15 @@ func (c *cache) RLock(key string) (string, bool) { func (c *cache) Unlock(key string) { if err := c.client.Call("Cache.Unlock", key, new(interface{})); err != nil { - panic(err) + log.Printf("[ERR] Cache.Unlock error: %s", err) + return } } func (c *cache) RUnlock(key string) { if err := c.client.Call("Cache.RUnlock", key, new(interface{})); err != nil { - panic(err) + log.Printf("[ERR] Cache.RUnlock error: %s", err) + return } }