Commit f3010b75 authored by Klaus Aehlig's avatar Klaus Aehlig
Browse files

Also clean up stale livelock files



Upon detection of a stale livelock, make WConfD also
try to clean it up. We can safely ignore any failures,
as the Ganeti resources are already freed, and the worst
thing that can happen is an empty file left over in the
file system.
Signed-off-by: default avatarKlaus Aehlig <aehlig@google.com>
Reviewed-by: default avatarPetr Pudlak <pudlak@google.com>
parent 01e7bf98
......@@ -36,7 +36,7 @@ module Ganeti.WConfd.DeathDetection
) where
import Control.Concurrent (threadDelay)
import Control.Exception (bracket)
import Control.Exception (bracket, try)
import Control.Monad
import System.Directory
import System.IO
......@@ -75,5 +75,8 @@ cleanupLocksTask = forever . runResultT $ do
when died $ do
logInfo $ show owner ++ " died, releasing locks"
modifyLockAllocation_ (`L.freeLocks` owner)
_ <- liftIO . try $ removeFile fpath
:: WConfdMonad (Either IOError ())
return ()
mapM_ cleanupIfDead owners
liftIO $ threadDelay cleanupInterval
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment