dovecot-2.2: director: Added director_user_kick_delay setting.

dovecot at dovecot.org dovecot at dovecot.org
Mon Sep 7 17:25:41 UTC 2015


details:   http://hg.dovecot.org/dovecot-2.2/rev/3ebba506c2c7
changeset: 19108:3ebba506c2c7
user:      Timo Sirainen <tss at iki.fi>
date:      Mon Sep 07 20:24:25 2015 +0300
description:
director: Added director_user_kick_delay setting.
This replaces the hardcoded 2 seconds delay. This setting specifies how long
to wait for after user has been kicked from all directors before letting the
user login to the new server. This timeout should be large enough that the
user's existing processes in the old backend should be finished.

diffstat:

 src/director/director-settings.c |  2 ++
 src/director/director-settings.h |  1 +
 src/director/director.c          |  6 ++++--
 3 files changed, 7 insertions(+), 2 deletions(-)

diffs (53 lines):

diff -r 2eeef1619161 -r 3ebba506c2c7 src/director/director-settings.c
--- a/src/director/director-settings.c	Mon Sep 07 18:50:24 2015 +0300
+++ b/src/director/director-settings.c	Mon Sep 07 20:24:25 2015 +0300
@@ -72,6 +72,7 @@
 	DEF(SET_STR, director_mail_servers),
 	DEF(SET_STR, director_username_hash),
 	DEF(SET_TIME, director_user_expire),
+	DEF(SET_TIME, director_user_kick_delay),
 	DEF(SET_IN_PORT, director_doveadm_port),
 	DEF(SET_BOOL, director_consistent_hashing),
 
@@ -85,6 +86,7 @@
 	.director_mail_servers = "",
 	.director_username_hash = "%Lu",
 	.director_user_expire = 60*15,
+	.director_user_kick_delay = 2,
 	.director_doveadm_port = 0
 };
 
diff -r 2eeef1619161 -r 3ebba506c2c7 src/director/director-settings.h
--- a/src/director/director-settings.h	Mon Sep 07 18:50:24 2015 +0300
+++ b/src/director/director-settings.h	Mon Sep 07 20:24:25 2015 +0300
@@ -10,6 +10,7 @@
 	const char *director_mail_servers;
 	const char *director_username_hash;
 	unsigned int director_user_expire;
+	unsigned int director_user_kick_delay;
 	in_port_t director_doveadm_port;
 	bool director_consistent_hashing;
 };
diff -r 2eeef1619161 -r 3ebba506c2c7 src/director/director.c
--- a/src/director/director.c	Mon Sep 07 18:50:24 2015 +0300
+++ b/src/director/director.c	Mon Sep 07 20:24:25 2015 +0300
@@ -17,7 +17,6 @@
 #define DIRECTOR_RECONNECT_RETRY_SECS 60
 #define DIRECTOR_RECONNECT_TIMEOUT_MSECS (30*1000)
 #define DIRECTOR_USER_MOVE_TIMEOUT_MSECS (30*1000)
-#define DIRECTOR_USER_MOVE_FINISH_DELAY_MSECS (2*1000)
 #define DIRECTOR_SYNC_TIMEOUT_MSECS (5*1000)
 #define DIRECTOR_RING_MIN_WAIT_SECS 20
 #define DIRECTOR_QUICK_RECONNECT_TIMEOUT_MSECS 1000
@@ -667,7 +666,10 @@
 	user->kill_state = USER_KILL_STATE_DELAY;
 	timeout_remove(&user->to_move);
 
-	user->to_move = timeout_add(DIRECTOR_USER_MOVE_FINISH_DELAY_MSECS,
+	/* wait for a while for the kills to finish in the backend server,
+	   so there are no longer any processes running for the user before we
+	   start letting new in connections to the new server. */
+	user->to_move = timeout_add(dir->set->director_user_kick_delay * 1000,
 				    director_user_kill_finish_delayed_to, ctx);
 }
 


More information about the dovecot-cvs mailing list