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),
.director_mail_servers = "",
.director_username_hash = "%Lu",
.director_user_expire = 60*15,
+ .director_user_kick_delay = 2,
.director_doveadm_port = 0
};
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;
};
#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
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);
}