{ '\0', NULL, NULL }
};
- /* execute flush script, if set */
- if (*dir->set->director_flush_socket == '\0') {
+ /* Execute flush script, if set. Only the director that started the
+ user moving will call the flush script. Having each director do it
+ would be redundant since they're all supposed to be performing the
+ same flush task to the same backend. */
+ if (*dir->set->director_flush_socket == '\0' ||
+ !user->kill_is_self_initiated) {
director_user_kill_finish_delayed(dir, user, FALSE);
return;
}
dir_debug("User %u move finished at state=%s", user->username_hash,
user_kill_state_names[user->kill_state]);
+ user->kill_is_self_initiated = FALSE;
user->kill_state = USER_KILL_STATE_NONE;
timeout_remove(&user->to_move);
dir->users_moving_count++;
user->to_move = timeout_add(DIRECTOR_USER_MOVE_TIMEOUT_MSECS,
director_user_move_timeout, user);
+ user->kill_is_self_initiated = src->self;
user->kill_state = USER_KILL_STATE_KILLING;
cmd = t_strdup_printf("proxy\t*\tKICK-DIRECTOR-HASH\t%u",
username_hash);
now doing a ring-wide sync for this user to make sure we don't
assign conflicting hosts to it */
unsigned int weak:1;
+ /* TRUE, if this server initiated the user's kill. */
+ unsigned int kill_is_self_initiated:1;
};
/* Create a new directory. Users are dropped if their time gets older