dovecot-2.2: indexer-worker: Use provided session-id only as a p...

dovecot at dovecot.org dovecot at dovecot.org
Wed Nov 18 19:06:48 UTC 2015


details:   http://hg.dovecot.org/dovecot-2.2/rev/cd347fd1791a
changeset: 19398:cd347fd1791a
user:      Timo Sirainen <tss at iki.fi>
date:      Wed Nov 18 21:06:17 2015 +0200
description:
indexer-worker: Use provided session-id only as a prefix for a unique session ID.
Fixes stats process's "Duplicate session ID" errors when LMTP delivers to
multiple recipients.

diffstat:

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

diffs (21 lines):

diff -r e976d6f988ec -r cd347fd1791a src/indexer/master-connection.c
--- a/src/indexer/master-connection.c	Wed Nov 18 21:03:41 2015 +0200
+++ b/src/indexer/master-connection.c	Wed Nov 18 21:06:17 2015 +0200
@@ -212,11 +212,12 @@
 	input.module = "mail";
 	input.service = "indexer-worker";
 	input.username = args[0];
-	/* 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 session-id is given, use it as a prefix to a unique session ID.
+	   we can't use the session-id directly or stats process will complain
+	   about duplicates. (especially LMTP would use the same session-id for
+	   multiple users' indexing at the same time.) */
+	if (args[2][0] != '\0')
+		input.session_id_prefix = args[2];
 
 	if (mail_storage_service_lookup_next(conn->storage_service, &input,
 					     &service_user, &user, &error) <= 0) {


More information about the dovecot-cvs mailing list