LGTM (with the interdiff), thanks.

On Tue, Apr 8, 2014 at 3:43 PM, Klaus Aehlig <[email protected]> wrote:

>
> Hi Petr,
>
> As discussed offline, I'd like to include the following interdiff to avoid
> over-notification. Thanks for finding the bug.
>
> commit 4340e5d8382cb5743f631781a61f6cea5e9c62b8
> Author: Klaus Aehlig <[email protected]>
> Date:   Tue Apr 8 15:35:50 2014 +0200
>
>     INTERDIFF Add functions to update locks in a waiting structure
>
> diff --git a/src/Ganeti/Locking/Waiting.hs b/src/Ganeti/Locking/Waiting.hs
> index e062b44..477a6c8 100644
> --- a/src/Ganeti/Locking/Waiting.hs
> +++ b/src/Ganeti/Locking/Waiting.hs
> @@ -114,7 +114,7 @@ revisitRequests :: (Lock a, Ord b, Ord c)
>                  -> S.Set b -- ^ the owners where requests keyed by them
> need
>                             -- to be revisited
>                  -> LockWaiting a b c -- ^ state before revisiting
> -                -> (S.Set b, LockWaiting a b c) -- ^ owners to notify and
> state
> +                -> (S.Set b, LockWaiting a b c) -- ^ owners visited and
> state
>                                                  -- after revisiting
>  revisitRequests notify todo state =
>    let getRequests (pending, reqs) owner =
> @@ -155,7 +155,10 @@ updateLocks owner reqs state =
>         else if result /= Ok S.empty -- skip computation if request could
> not
>                                      -- be handled anyway
>                then (state, (result, S.empty))
> -              else (state'', (result, notify))
> +              else let pendingOwners' = lwPendingOwners state''
> +                       toNotify = S.filter (not . flip M.member
> pendingOwners')
> +                                           notify
> +                   in (state'', (result, toNotify))
>
>  -- | Update locks as soon as possible. If the request cannot be fulfilled
>  -- immediately add the request to the waiting queue. The first argument is
>
>
> --
> 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