[SCM] Samba Shared Repository - branch master updated
Volker Lendecke
vlendec at samba.org
Fri Jan 14 01:58:01 MST 2011
The branch, master has been updated
via 70b4c08 s3:vfs aio_fork children do not go away
via fa07208 s3:vfs fix children cleanup in aio_fork
from 8e02335 waf: this script does need bash
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 70b4c08c813af5d45e3b4af0503f851f52744381
Author: Christian Ambach <christian.ambach at de.ibm.com>
Date: Thu Jan 13 16:04:36 2011 +0100
s3:vfs aio_fork children do not go away
on RHEL 5.5, recvmsg() does not return when it is reading
from the socket and the process on the other side closes
its connection. This left aio children around that should
have gone already and were just wasting system resources.
This patch makes the child go away by writing invalid
data to it so that the child exits.
Pair-Programmed-With: Volker Lendecke <vl at samba.org>
Autobuild-User: Volker Lendecke <vlendec at samba.org>
Autobuild-Date: Fri Jan 14 09:57:18 CET 2011 on sn-devel-104
commit fa07208cee41b51d68144e2fe14d274fdb8f4873
Author: Christian Ambach <christian.ambach at de.ibm.com>
Date: Thu Jan 13 15:59:18 2011 +0100
s3:vfs fix children cleanup in aio_fork
the cleanup loop in aio_fork always stopped operation
on the first inactive child it found. In case lots of
children need to be reaped, it will take multiple runs
before all children are gone
-----------------------------------------------------------------------
Summary of changes:
source3/modules/vfs_aio_fork.c | 15 ++++++++++++++-
1 files changed, 14 insertions(+), 1 deletions(-)
Changeset truncated at 500 lines:
diff --git a/source3/modules/vfs_aio_fork.c b/source3/modules/vfs_aio_fork.c
index 90d06b1..0d51513 100644
--- a/source3/modules/vfs_aio_fork.c
+++ b/source3/modules/vfs_aio_fork.c
@@ -246,6 +246,7 @@ static void aio_child_cleanup(struct event_context *event_ctx,
"deleting\n", (int)child->pid));
TALLOC_FREE(child);
+ child = next;
}
if (list->children != NULL) {
@@ -421,7 +422,18 @@ static void handle_aio_completion(struct event_context *event_ctx,
static int aio_child_destructor(struct aio_child *child)
{
+ char c=0;
+
SMB_ASSERT((child->aiocb == NULL) || child->cancelled);
+
+ DEBUG(10, ("aio_child_destructor: removing child %d on fd %d\n",
+ child->pid, child->sockfd));
+
+ /*
+ * closing the sockfd makes the child not return from recvmsg() on RHEL
+ * 5.5 so instead force the child to exit by writing bad data to it
+ */
+ write(child->sockfd, &c, sizeof(c));
close(child->sockfd);
DLIST_REMOVE(child->list->children, child);
return 0;
@@ -485,7 +497,8 @@ static NTSTATUS create_aio_child(struct smbd_server_connection *sconn,
aio_child_loop(result->sockfd, result->map);
}
- DEBUG(10, ("Child %d created\n", result->pid));
+ DEBUG(10, ("Child %d created with sockfd %d\n",
+ result->pid, fdpair[0]));
result->sockfd = fdpair[0];
close(fdpair[1]);
--
Samba Shared Repository
More information about the samba-cvs
mailing list