Mercurial > dovecot > core-2.2
changeset 13278:fa2425fd9cf4
indexer: Treat worker connections as client connections to avoid early idle-kills.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Tue, 23 Aug 2011 03:31:50 +0300 |
parents | 030e33bde821 |
children | 7d4e9c85ff2d |
files | src/indexer/worker-pool.c |
diffstat | 1 files changed, 7 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/indexer/worker-pool.c Tue Aug 23 03:31:15 2011 +0300 +++ b/src/indexer/worker-pool.c Tue Aug 23 03:31:50 2011 +0300 @@ -3,6 +3,7 @@ #include "lib.h" #include "ioloop.h" #include "llist.h" +#include "master-service.h" #include "worker-connection.h" #include "worker-pool.h" @@ -48,6 +49,7 @@ struct worker_connection_list *list = pool->busy_list; DLLIST_REMOVE(&pool->busy_list, list); + master_service_client_connection_destroyed(master_service); worker_connection_list_free(pool, list); } @@ -142,6 +144,10 @@ list = pool->idle_list; DLLIST_REMOVE(&pool->idle_list, list); DLLIST_PREPEND(&pool->busy_list, list); + /* treat worker connection as another client. this is required (once, + at least) so that master doesn't think we are busy doing nothing and + ignoring an idle-kill. */ + master_service_client_connection_created(master_service); *conn_r = list->conn; return TRUE; @@ -179,6 +185,7 @@ i_assert(list != NULL); DLLIST_REMOVE(&pool->busy_list, list); + master_service_client_connection_destroyed(master_service); if (!worker_connection_is_connected(conn)) worker_connection_list_free(pool, list);