]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
dsync: If locking fails, fail instead of continuing.
authorTimo Sirainen <tss@iki.fi>
Sun, 17 Feb 2013 06:50:18 +0000 (08:50 +0200)
committerTimo Sirainen <tss@iki.fi>
Sun, 17 Feb 2013 06:50:18 +0000 (08:50 +0200)
src/doveadm/dsync/dsync-brain.c

index 822e97fca2e321e3eb8cb1721dbdf93896e33f09..8a4de03b6ca183975c508843659e030ac34fc876 100644 (file)
@@ -259,8 +259,10 @@ static bool dsync_brain_master_recv_handshake(struct dsync_brain *brain)
                return FALSE;
 
        if (brain->lock_timeout > 0) {
-               if (dsync_brain_lock(brain, ibc_set->hostname) < 0)
+               if (dsync_brain_lock(brain, ibc_set->hostname) < 0) {
+                       brain->failed = TRUE;
                        return FALSE;
+               }
        }
 
        brain->state = brain->sync_type == DSYNC_BRAIN_SYNC_TYPE_STATE ?
@@ -280,8 +282,10 @@ static bool dsync_brain_slave_recv_handshake(struct dsync_brain *brain)
 
        if (ibc_set->lock_timeout > 0) {
                brain->lock_timeout = ibc_set->lock_timeout;
-               if (dsync_brain_lock(brain, ibc_set->hostname) < 0)
+               if (dsync_brain_lock(brain, ibc_set->hostname) < 0) {
+                       brain->failed = TRUE;
                        return FALSE;
+               }
        }
 
        if (ibc_set->sync_ns_prefix != NULL) {