summaryrefslogtreecommitdiffstats
path: root/source3/smbd
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2014-02-24 12:23:49 +0000
committerJeremy Allison <jra@samba.org>2014-04-23 22:33:08 +0200
commit29603d1cd9072bf32adfe13ee3d764fd13d12bd0 (patch)
treef75503cedea76fe50fc46c70c21d3c3fdb3baaeb /source3/smbd
parent3e24e07467962436fa505f3b8e591f1af6cafdc0 (diff)
downloadsamba-29603d1cd9072bf32adfe13ee3d764fd13d12bd0.tar.gz
samba-29603d1cd9072bf32adfe13ee3d764fd13d12bd0.tar.xz
samba-29603d1cd9072bf32adfe13ee3d764fd13d12bd0.zip
lib: Add messaging_dgm
Messaging based on unix domain datagram sockets This makes every process participating in messaging bind on a unix domain datagram socket, similar to the source4 based messaging. The details are a bit different though: Retry after EWOULDBLOCK is done with a blocking thread, not by polling. This was the only way I could in experiments avoid a thundering herd or high load under Linux in extreme overload situations like many thousands of processes sending to one blocked process. If there are better ideas to do this in a simple way, I'm more than happy to remove the pthreadpool dependency again. There is only one socket per process, not per task. I don't think that per-task sockets are really necessary, we can do filtering in user space. The message contains the destination server_id, which contains the destination task_id. I think we can rebase the source4 based imessaging on top of this, allowing multiple imessaging contexts on top of one messaging_context. I had planned to do this conversion before this goes in, but Jeremy convinced me that this has value in itself :-) Per socket we also create a fcntl-based lockfile to allow race-free cleanup of orphaned sockets. This lockfile contains the unique_id, which in the future will make the server_id.tdb obsolete. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/server.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/source3/smbd/server.c b/source3/smbd/server.c
index 96580ba4e2e..5ff370d1edb 100644
--- a/source3/smbd/server.c
+++ b/source3/smbd/server.c
@@ -465,6 +465,8 @@ static void remove_child_pid(struct smbd_parent_context *parent,
}
if (unclean_shutdown) {
+ NTSTATUS status;
+
/* a child terminated uncleanly so tickle all
processes to see if they can grab any of the
pending locks
@@ -488,6 +490,10 @@ static void remove_child_pid(struct smbd_parent_context *parent,
* terminated uncleanly.
*/
messaging_cleanup_server(parent->msg_ctx, child_id);
+
+ status = messaging_dgm_cleanup(parent->msg_ctx, pid);
+ DEBUG(10, ("%s: messaging_dgm_cleanup returned %s\n",
+ __func__, nt_errstr(status)));
}
if (!serverid_deregister(child_id)) {