LGTM, thanks

On Mon, Mar 3, 2014 at 4:44 PM, Klaus Aehlig <[email protected]> wrote:

> On Mon, Mar 03, 2014 at 04:20:26PM +0100, Petr Pudlák wrote:
> > I'd suggest to call it something like 'updateLocksNonBlocking' or
> > 'tryUpdateLocks', because we'll also have a blocking variant, for which
> the
> > plain name 'updateLocks' seems more appropriate. Also I'd suggest to
> > document what the result means in the Haddock comment, so that it's not
> > necessary to go into the internals to understand what the function does
> ([]
> > = locks acquired, non-empty = lock-blocking jobs, no locks acquired).
>
> FYI.
>
> commit abe0012821d4d2493ce13928d3a206bb39bfc210
> Author: Klaus Aehlig <[email protected]>
> Date:   Mon Mar 3 16:42:11 2014 +0100
>
>     Interdiff [PATCH master 05/10] Export updateLocks through WConfD
>
> diff --git a/src/Ganeti/WConfd/Core.hs b/src/Ganeti/WConfd/Core.hs
> index c5caf62..b92a2c9 100644
> --- a/src/Ganeti/WConfd/Core.hs
> +++ b/src/Ganeti/WConfd/Core.hs
> @@ -59,9 +59,13 @@ listLocks :: JobId -> FilePath -> WConfdMonad
> [(GanetiLocks, L.OwnerState)]
>  listLocks jid fpath =
>    liftM (M.toList . L.listLocks (jid, fpath)) readLockAllocation
>
> --- | Update the locks of a given owner (i.e., a job-id lockfile pair).
> -updateLocks :: JobId -> FilePath -> GanetiLockRequest -> WConfdMonad
> [JobId]
> -updateLocks jid fpath req =
> +-- | Try to update the locks of a given owner (i.e., a job-id lockfile
> pair).
> +-- This function always returns immediately. If the lock update was
> possible,
> +-- the empty list is returned; otherwise, the lock status is left
> completly
> +-- unchanged, and the return value is the list of jobs which need to
> release
> +-- some locks before this request can succeed.
> +tryUpdateLocks :: JobId -> FilePath -> GanetiLockRequest -> WConfdMonad
> [JobId]
> +tryUpdateLocks jid fpath req =
>    liftM (S.toList . S.map fst)
>    . (>>= toErrorStr)
>    $ modifyLockAllocation (L.updateLocks (jid, fpath)
> @@ -74,5 +78,5 @@ exportedFunctions = [ 'echo
>                      , 'readConfig
>                      , 'writeConfig
>                      , 'listLocks
> -                    , 'updateLocks
> +                    , 'tryUpdateLocks
>                      ]
>
>
> > Otherwise LGTM, no need to resend.
>
> Thanks.
>
> --
> Klaus Aehlig
> Google Germany GmbH, Dienerstr. 12, 80331 Muenchen
> Registergericht und -nummer: Hamburg, HRB 86891
> Sitz der Gesellschaft: Hamburg
> Geschaeftsfuehrer: Graham Law, Christine Elizabeth Flores
>

Reply via email to