comparison src/director/user-directory.h @ 22673:867c3905ac0b

director: Avoid USER loops when ring latency is over 1 second Do this by adding a timestamp parameter to USER events. This way if it takes over 1 second for the USER event to traverse the ring, it won't get into an infinite loop getting the user updated over and over again.
author Timo Sirainen <timo.sirainen@dovecot.fi>
date Sun, 26 Nov 2017 01:19:35 +0200
parents 6d37f4dd198d
children c9549bea9106
comparison
equal deleted inserted replaced
22672:d811474ef901 22673:867c3905ac0b
3 3
4 #define USER_IS_BEING_KILLED(user) \ 4 #define USER_IS_BEING_KILLED(user) \
5 ((user)->kill_ctx != NULL) 5 ((user)->kill_ctx != NULL)
6 6
7 struct user { 7 struct user {
8 /* sorted by time */ 8 /* Approximately sorted by time (except during handshaking).
9 The sorting order may be constantly wrong a few seconds here and
10 there. */
9 struct user *prev, *next; 11 struct user *prev, *next;
10 12
11 /* first 32 bits of MD5(username). collisions are quite unlikely, but 13 /* first 32 bits of MD5(username). collisions are quite unlikely, but
12 even if they happen it doesn't matter - the users are just 14 even if they happen it doesn't matter - the users are just
13 redirected to same server */ 15 redirected to same server */