]> 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)
committerGitLab <gitlab@git.dovecot.net>
Thu, 16 Mar 2017 07:07:45 +0000 (09:07 +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 b99fc5ad0f7396cb99a551431023f632b0207eca..e53eb6b314aaefa6b163e355891e5032a3eb90a6 100644 (file)
@@ -448,6 +448,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 eaf7ff5ae37a78be36a18624e91ca8f48b7d7946..0a4ceb38cff3e66cae68a0dd3873d5d3b6bec01f 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 680d6bc13a03675ce13197e70bf089eba26be8d4..ad2a3594b743eda86733dfa9eb661d75b9409b27 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 381b057765588b244182eb6df7d6c2bde8b66e2e..ea846457fa042f306b8247993b9e35ac8434d98a 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 8c4b695935a59fef53fbf4f91a8069ba4695abd4..b02e15ef4881c41d57d2d1f1142b0b9de1c229a2 100644 (file)
@@ -612,6 +612,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)