dovecot-2.2: indexer: Properly fix crashing at deinit when there...

dovecot at dovecot.org dovecot at dovecot.org
Mon Jun 29 09:08:19 UTC 2015


details:   http://hg.dovecot.org/dovecot-2.2/rev/85822087fe3d
changeset: 18890:85822087fe3d
user:      Timo Sirainen <tss at iki.fi>
date:      Mon Jun 29 12:05:25 2015 +0300
description:
indexer: Properly fix crashing at deinit when there are pending requests.

diffstat:

 src/indexer/indexer-queue.c |  9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diffs (19 lines):

diff -r 1458276c0a07 -r 85822087fe3d src/indexer/indexer-queue.c
--- a/src/indexer/indexer-queue.c	Mon Jun 29 12:00:05 2015 +0300
+++ b/src/indexer/indexer-queue.c	Mon Jun 29 12:05:25 2015 +0300
@@ -235,6 +235,15 @@
 void indexer_queue_cancel_all(struct indexer_queue *queue)
 {
 	struct indexer_request *request;
+	struct hash_iterate_context *iter;
+
+	/* remove all reindex-markers so when the current requests finish
+	   (or are cancelled) we don't try to retry them (especially during
+	   deinit where it crashes) */
+	iter = hash_table_iterate_init(queue->requests);
+	while (hash_table_iterate(iter, queue->requests, &request, &request))
+		request->reindex_head = request->reindex_tail = FALSE;
+	hash_table_iterate_deinit(&iter);
 
 	while ((request = indexer_queue_request_peek(queue)) != NULL) {
 		indexer_queue_request_remove(queue);


More information about the dovecot-cvs mailing list