Always unlock the lockfile when killing the app.

Otherwise, we have a deadlock whenever the lock is forced: the app
will be restarted, and will find the lockfile is already there so it won't be
able to lock/unlock it. The supervisor will have the same problem.
So the solution is that, whenever we kill the app, that is the lock owner, we also unlock the file.
This commit is contained in:
Pablo Carranza Vélez 2015-09-08 08:55:18 +00:00
parent 752c43f628
commit 6e62366541

View File

@ -110,6 +110,8 @@ exports.kill = kill = (app) ->
if statusCode is '404'
return
throw err
.tap ->
lockFile.unlockAsync(lockPath(app))
.tap ->
logSystemEvent(logTypes.stopAppSuccess, app)
app.containerId = null