]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
director: Add more debug logging for moving & killing users
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Fri, 20 Jan 2017 13:57:10 +0000 (15:57 +0200)
committerGitLab <gitlab@git.dovecot.net>
Fri, 20 Jan 2017 15:46:57 +0000 (17:46 +0200)
src/director/director.c

index c3b8ff6a2f0a86576001fa80413a832eb897dac2..941c211fdf2d072fa6143a430cf4e0e5bb7ecf38 100644 (file)
@@ -897,6 +897,10 @@ director_finish_user_kill(struct director *dir, struct user *user, bool self)
        i_assert(kill_ctx->kill_state != USER_KILL_STATE_FLUSHING);
        i_assert(kill_ctx->kill_state != USER_KILL_STATE_DELAY);
 
+       dir_debug("User %u kill finished - %sstate=%s", user->username_hash,
+                 self ? "we started it " : "",
+                 user_kill_state_names[kill_ctx->kill_state]);
+
        if (dir->right == NULL) {
                /* we're alone */
                director_flush_user(dir, user);
@@ -1055,6 +1059,8 @@ void director_move_user(struct director *dir, struct director_host *src,
        */
        user = user_directory_lookup(users, username_hash);
        if (user == NULL) {
+               dir_debug("User %u move started: User was nonexistent",
+                         username_hash);
                user = user_directory_add(users, username_hash,
                                          host, ioloop_time);
        } else if (user->host == host) {
@@ -1063,6 +1069,8 @@ void director_move_user(struct director *dir, struct director_host *src,
                   killing any of our connections. */
                old_host = user->host;
                user->timestamp = ioloop_time;
+               dir_debug("User %u move forwarded: host is already %s",
+                         username_hash, net_ip2addr(&host->ip));
        } else {
                /* user is looked up via the new host's tag, so if it's found
                   the old tag has to be the same. */
@@ -1073,6 +1081,9 @@ void director_move_user(struct director *dir, struct director_host *src,
                user->host = host;
                user->host->user_count++;
                user->timestamp = ioloop_time;
+               dir_debug("User %u move started: host %s -> %s",
+                         username_hash, net_ip2addr(&old_host->ip),
+                         net_ip2addr(&host->ip));
        }
 
        if (orig_src == NULL) {