From: Timo Sirainen Date: Thu, 24 Mar 2016 00:36:14 +0000 (+0900) Subject: director: Fixed user weakness getting stuck if multiple directors set user weak simul... X-Git-Tag: 2.2.24~133 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f8c57c39abd8d987fdbc90dff5289b420017a700;p=thirdparty%2Fdovecot%2Fcore.git director: Fixed user weakness getting stuck if multiple directors set user weak simultaneously --- diff --git a/src/director/director-connection.c b/src/director/director-connection.c index a0d15975da..fd301b795b 100644 --- a/src/director/director-connection.c +++ b/src/director/director-connection.c @@ -824,9 +824,16 @@ director_cmd_user_weak(struct director_connection *conn, return TRUE; } - if (ret == 0) - ; - else if (dir_host == conn->dir->self_host) { + if (ret == 0) { + /* First time we're seeing this - forward it to others also. + We'll want to do it even if the user was already marked as + weak, because otherwise if two directors mark the user weak + at the same time both the USER-WEAK notifications reach + only half the directors until they collide and neither one + finishes going through the whole ring marking the user + non-weak. */ + weak_forward = TRUE; + } else if (dir_host == conn->dir->self_host) { /* We originated this USER-WEAK request. The entire ring has seen it and there weren't any conflicts. Make the user non-weak. */ dir_debug("user refresh: %u Our USER-WEAK seen by the entire ring",