From: Timo Sirainen Date: Sun, 4 Apr 2010 22:54:28 +0000 (+0300) Subject: dsync: Don't repeatedly try to keep opening the same failing mailbox. X-Git-Tag: 2.0.beta5~225 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2d7dcf2c4502272fb96879b30ace2b43b2a02585;p=thirdparty%2Fdovecot%2Fcore.git dsync: Don't repeatedly try to keep opening the same failing mailbox. --HG-- branch : HEAD --- diff --git a/src/dsync/dsync-worker-local.c b/src/dsync/dsync-worker-local.c index 3a51b7da6c..a298a9b43d 100644 --- a/src/dsync/dsync-worker-local.c +++ b/src/dsync/dsync-worker-local.c @@ -1295,13 +1295,13 @@ local_worker_select_mailbox(struct dsync_worker *_worker, (struct local_dsync_worker *)_worker; struct mailbox_transaction_context *trans, *ext_trans; - if (worker->selected_box != NULL) { - if (dsync_guid_equals(&worker->selected_box_guid, mailbox)) { - /* already selected */ - return; - } - local_worker_mailbox_close(worker); + if (dsync_guid_equals(&worker->selected_box_guid, mailbox)) { + /* already selected or previous select failed */ + i_assert(worker->selected_box != NULL || _worker->failed); + return; } + if (worker->selected_box != NULL) + local_worker_mailbox_close(worker); worker->selected_box_guid = *mailbox; if (local_mailbox_open(worker, mailbox, &worker->selected_box) < 0) {