]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
director: Show in process title how many users are being moved.
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Mon, 24 Oct 2016 17:07:26 +0000 (20:07 +0300)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Tue, 25 Oct 2016 18:01:22 +0000 (21:01 +0300)
src/director/director.c
src/director/director.h
src/director/main.c

index f9f9db9de2578f5cae503bf2afaa5a7aa0ddd54d..6c0216f4d3eafa89b822cdadc8c52aa370f0daa6 100644 (file)
@@ -808,6 +808,9 @@ static void director_user_move_free(struct director *dir, struct user *user)
        user->kill_state = USER_KILL_STATE_NONE;
        timeout_remove(&user->to_move);
 
+       i_assert(dir->users_moving_count > 0);
+       dir->users_moving_count--;
+
        dir->state_change_callback(dir);
 }
 
@@ -978,6 +981,7 @@ void director_move_user(struct director *dir, struct director_host *src,
                ctx->username_hash = username_hash;
                ctx->self = src->self;
 
+               dir->users_moving_count++;
                user->to_move = timeout_add(DIRECTOR_USER_MOVE_TIMEOUT_MSECS,
                                            director_user_move_timeout, user);
                user->kill_state = USER_KILL_STATE_KILLING;
index 64681cfe6974fd2fa5455cb75261fe2af099ce44..9cd6f8f8afcfe0bf4e44022e170b02a8e7c976e1 100644 (file)
@@ -65,6 +65,8 @@ struct director {
        struct mail_host_list *orig_config_hosts;
        /* temporary user -> host associations */
        struct user_directory *users;
+       /* Number of users currently being moved */
+       unsigned int users_moving_count;
 
        /* these requests are waiting for directors to be in synced */
        ARRAY(struct director_request *) pending_requests;
index a65ed9d59c5ccf28084d305901c9a3f3b6611a2e..0ecdd9308a03d5226ccb926a0551fb6a931101ed 100644 (file)
@@ -47,6 +47,8 @@ static void director_refresh_proctitle_timeout(void *context ATTR_UNUSED)
 
        str = t_str_new(64);
        str_printfa(str, "[%u users", user_directory_count(director->users));
+       if (director->users_moving_count > 0)
+               str_printfa(str, ", %u moving", director->users_moving_count);
        str_printfa(str, ", %lu req/s",
                    (unsigned long)(director->num_requests - prev_requests));
        str_printfa(str, ", %llu+%llu kB/s",