summaryrefslogtreecommitdiff
path: root/source3/lib/server_prefork.h
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2011-08-18 10:31:36 -0400
committerSimo Sorce <idra@samba.org>2011-08-21 09:05:06 -0400
commit7bb4b991a54c85e7ca9fcfd15f85a38940ce6dfe (patch)
treeb2b412989e17d73da40848715b9aee2bb607b5b0 /source3/lib/server_prefork.h
parentfeadd849ba6e36896cf38cada170ff53c4b03258 (diff)
downloadsamba-7bb4b991a54c85e7ca9fcfd15f85a38940ce6dfe.tar.gz
samba-7bb4b991a54c85e7ca9fcfd15f85a38940ce6dfe.tar.bz2
samba-7bb4b991a54c85e7ca9fcfd15f85a38940ce6dfe.zip
s3-prefork: Fix code to retire children
We have to be more careful when retiring children. We cannot stop accepting connections as soon as the server tells us to quit because if max_children is reached and we still have clients connected, the server will not be able to spawn new children until one exits. And children will not exit until all the clients closed the connections. So we keep operating past our recall until we have 0 connections. Also do not try to recall children that still have >= 1 clients connected, they couldn't anyway. Also use messaging to warn children and not SIGHUP. Signed-off-by: Andreas Schneider <asn@samba.org> Signed-off-by: Simo Sorce <idra@samba.org>
Diffstat (limited to 'source3/lib/server_prefork.h')
-rw-r--r--source3/lib/server_prefork.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/source3/lib/server_prefork.h b/source3/lib/server_prefork.h
index 17491536ff..1d203e6317 100644
--- a/source3/lib/server_prefork.h
+++ b/source3/lib/server_prefork.h
@@ -152,6 +152,7 @@ int prefork_add_children(struct tevent_context *ev_ctx,
/**
* @brief Commands a number of children to stop and exit
*
+* @param msg_ctx The messaging context.
* @param pfp The pool.
* @param num_children The number of children we need to retire.
* @param age_limit The minimum age a child has been active to be
@@ -165,7 +166,8 @@ int prefork_add_children(struct tevent_context *ev_ctx,
* If all the available children are too young or are busy then it
* is possible that none will be asked to stop.
*/
-int prefork_retire_children(struct prefork_pool *pfp,
+int prefork_retire_children(struct messaging_context *msg_ctx,
+ struct prefork_pool *pfp,
int num_children, time_t age_limit);
/**
* @brief Count the number of children