dovecot-2.2: virtual: Fixed assert-crash in IDLE caused by earli...
dovecot at dovecot.org
dovecot at dovecot.org
Wed Apr 23 13:45:41 UTC 2014
details: http://hg.dovecot.org/dovecot-2.2/rev/79bfc730a8b0
changeset: 17249:79bfc730a8b0
user: Timo Sirainen <tss at iki.fi>
date: Wed Apr 23 16:45:10 2014 +0300
description:
virtual: Fixed assert-crash in IDLE caused by earlier changes.
This change negates all the improvements of the earlier changes when IDLE is
used. This could be fixed by using mailbox-list-notify.h API.
diffstat:
src/plugins/virtual/virtual-storage.c | 26 +++++++++++++++++---------
src/plugins/virtual/virtual-storage.h | 1 +
src/plugins/virtual/virtual-sync.c | 7 +++++--
3 files changed, 23 insertions(+), 11 deletions(-)
diffs (68 lines):
diff -r 0aa159d6ef30 -r 79bfc730a8b0 src/plugins/virtual/virtual-storage.c
--- a/src/plugins/virtual/virtual-storage.c Wed Apr 23 16:31:36 2014 +0300
+++ b/src/plugins/virtual/virtual-storage.c Wed Apr 23 16:45:10 2014 +0300
@@ -417,17 +417,25 @@
static void virtual_notify_changes(struct mailbox *box)
{
struct virtual_mailbox *mbox = (struct virtual_mailbox *)box;
- struct virtual_backend_box *const *bboxes;
- unsigned int i, count;
+ struct virtual_backend_box *const *bboxp;
- bboxes = array_get(&mbox->backend_boxes, &count);
- for (i = 0; i < count; i++) {
- struct mailbox *bbox = bboxes[i]->box;
+ if (box->notify_callback == NULL) {
+ array_foreach(&mbox->backend_boxes, bboxp)
+ mailbox_notify_changes_stop((*bboxp)->box);
+ return;
+ }
- if (box->notify_callback == NULL)
- mailbox_notify_changes_stop(bbox);
- else
- mailbox_notify_changes(bbox, virtual_notify_callback, box);
+ /* FIXME: if mailbox_list_index=yes, use mailbox-list-notify.h API
+ to wait for changes and avoid opening all mailboxes here. */
+
+ array_foreach(&mbox->backend_boxes, bboxp) {
+ if (mailbox_open((*bboxp)->box) < 0) {
+ /* we can't report error in here, so do it later */
+ (*bboxp)->open_failed = TRUE;
+ continue;
+ }
+ mailbox_notify_changes((*bboxp)->box,
+ virtual_notify_callback, box);
}
}
diff -r 0aa159d6ef30 -r 79bfc730a8b0 src/plugins/virtual/virtual-storage.h
--- a/src/plugins/virtual/virtual-storage.h Wed Apr 23 16:31:36 2014 +0300
+++ b/src/plugins/virtual/virtual-storage.h Wed Apr 23 16:45:10 2014 +0300
@@ -92,6 +92,7 @@
struct imap_match_glob *glob;
struct mail_namespace *ns;
+ unsigned int open_failed:1;
unsigned int sync_seen:1;
unsigned int wildcard:1;
unsigned int clear_recent:1;
diff -r 0aa159d6ef30 -r 79bfc730a8b0 src/plugins/virtual/virtual-sync.c
--- a/src/plugins/virtual/virtual-sync.c Wed Apr 23 16:31:36 2014 +0300
+++ b/src/plugins/virtual/virtual-sync.c Wed Apr 23 16:45:10 2014 +0300
@@ -1041,10 +1041,13 @@
mailbox. */
i_assert(array_count(&bbox->sync_pending_removes) == 0);
- if (bbox_index_opened) {
- /* index already opened, refresh it */
+ if (bbox_index_opened || bbox->open_failed) {
+ /* a) index already opened, refresh it
+ b) delayed error handling for mailbox_open()
+ that failed in virtual_notify_changes() */
if (mailbox_sync(bbox->box, sync_flags) < 0)
return -1;
+ bbox->open_failed = FALSE;
}
if (mailbox_get_status(bbox->box, STATUS_UIDVALIDITY |
More information about the dovecot-cvs
mailing list