Skip to content

Commit

Permalink
director: Fixed user weakness getting stuck if multiple directors set…
Browse files Browse the repository at this point in the history
… user weak simultaneously
  • Loading branch information
sirainen committed Mar 29, 2016
1 parent 1cccb7f commit d592ce4
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/director/director-connection.c
Expand Up @@ -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",
Expand Down

0 comments on commit d592ce4

Please sign in to comment.