]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
imap, pop3, indexer-worker: Add (deinit) to process title before autoexpunging runs.
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Wed, 8 Mar 2017 20:39:34 +0000 (15:39 -0500)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Thu, 16 Mar 2017 17:48:21 +0000 (19:48 +0200)
lmtp should also do this, but it needs a bit larger changes.

src/imap/imap-client.c
src/imap/main.c
src/indexer/master-connection.c
src/pop3/main.c
src/pop3/pop3-client.c

index 1158253b61d3a57296ccd074c71eab8127fefe11..c16bf8c02e0c3745c2e3c61fe7a26f925ad2cb8b 100644 (file)
@@ -453,6 +453,8 @@ static void client_default_destroy(struct client *client, const char *reason)
        /* i/ostreams are already closed at this stage, so fd can be closed */
        fd_close_maybe_stdio(&client->fd_in, &client->fd_out);
 
+       /* refresh proctitle before a potentially long-running user unref */
+       imap_refresh_proctitle();
        /* Free the user after client is already disconnected. It may start
           some background work like autoexpunging. */
        mail_user_unref(&client->user);
index 050692eebd214cb669a6d0dea6a0cca16ae74c60..fd9fd1950f677dcd7b446d6ffd2595f2b4abff2f 100644 (file)
@@ -88,6 +88,8 @@ void imap_refresh_proctitle(void)
                        if (o_stream_is_corked(client->output))
                                str_append(title, " corked");
                }
+               if (client->destroyed)
+                       str_append(title, " (deinit)");
                break;
        default:
                str_printfa(title, "%u connections", imap_client_count);
index aab4def2f1100f7ee143b73eebc85cabcea2628f..2033823610ad872e851c8afa3bfe99c9b6149819 100644 (file)
@@ -227,9 +227,12 @@ master_connection_input_line(struct master_connection *conn, const char *line)
                indexer_worker_refresh_proctitle(user->username, args[1], 0, 0);
                ret = index_mailbox(conn, user, args[1],
                                    max_recent_msgs, args[4]);
-               indexer_worker_refresh_proctitle(NULL, NULL, 0, 0);
+               /* refresh proctitle before a potentially long-running
+                  user unref */
+               indexer_worker_refresh_proctitle(user->username, "(deinit)", 0, 0);
                mail_user_unref(&user);
                mail_storage_service_user_unref(&service_user);
+               indexer_worker_refresh_proctitle(NULL, NULL, 0, 0);
        }
 
        str = ret < 0 ? "-1\n" : "100\n";
index 54bbc15eea61c2770e40196159df8f9eba4da373..685eeb011c157cdaa7584c60bd2078f25db6cd9a 100644 (file)
@@ -59,6 +59,8 @@ void pop3_refresh_proctitle(void)
                        str_append_c(title, ' ');
                        str_append(title, net_ip2addr(client->user->remote_ip));
                }
+               if (client->destroyed)
+                       str_append(title, " (deinit)");
                break;
        default:
                str_printfa(title, "%u connections", pop3_client_count);
index 0036122b4c9d11f5ecd55ca99f97880981c2ef8e..ce3a288bb93b515f6154eaf0315d75a30ed32eb4 100644 (file)
@@ -624,6 +624,9 @@ static void client_default_destroy(struct client *client, const char *reason)
                        mail_user_get_anvil_userip_ident(client->user),
                        "\n", NULL));
        }
+
+       /* refresh proctitle before a potentially long-running user unref */
+       pop3_refresh_proctitle();
        mail_user_unref(&client->user);
 
        if (client->session_dotlock != NULL)