The branch, v3-6-test has been updated via 67f35d2 s3:vfs aio_fork children do not go away via 381aaa3 s3:vfs fix children cleanup in aio_fork from 8b821f3 s3-build: remove RPCCLI_WINREG subsystem.
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-6-test - Log ----------------------------------------------------------------- commit 67f35d2151d23e951444163b2a0c6eb4e152ae19 Author: Christian Ambach <christian.amb...@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 <v...@samba.org> Autobuild-User: Volker Lendecke <vlen...@samba.org> Autobuild-Date: Fri Jan 14 09:57:18 CET 2011 on sn-devel-104 commit 381aaa3247c7e3c4cf6f99462543bbeed40b3d39 Author: Christian Ambach <christian.amb...@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