dovecot-2.2: indexer: Use a slightly different session ID than t...

dovecot at dovecot.org dovecot at dovecot.org
Thu Sep 24 13:31:46 UTC 2015


details:   http://hg.dovecot.org/dovecot-2.2/rev/e94781b25c83
changeset: 19210:e94781b25c83
user:      Timo Sirainen <tss at iki.fi>
date:      Thu Sep 24 16:30:23 2015 +0300
description:
indexer: Use a slightly different session ID than the session that requested indexing.
Required to avoid "duplicate session ID" errors in stats process.

Alternative would have been to change the stats protocol a bit and always
send the service name along with session ID, and use those two together as
the primary key. Maybe this could be done in future if we get more of these
kind of processes.

diffstat:

 src/indexer/master-connection.c |  6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diffs (16 lines):

diff -r a706bdec0200 -r e94781b25c83 src/indexer/master-connection.c
--- a/src/indexer/master-connection.c	Thu Sep 24 16:16:43 2015 +0300
+++ b/src/indexer/master-connection.c	Thu Sep 24 16:30:23 2015 +0300
@@ -212,7 +212,11 @@
 	input.module = "mail";
 	input.service = "indexer-worker";
 	input.username = args[0];
-	input.session_id = args[2][0] == '\0' ? NULL : args[2];
+	/* if session-id is given, add -idx suffix to it so that stats process
+	   doesn't complain about duplicates. also it's nicer to keep the stats
+	   separate for the indexer and the caller. */
+	input.session_id = args[2][0] == '\0' ? NULL :
+		t_strconcat(args[2], "-idx", NULL);
 
 	if (mail_storage_service_lookup_next(conn->storage_service, &input,
 					     &service_user, &user, &error) <= 0) {


More information about the dovecot-cvs mailing list