diff options
author | Volker Lendecke <vl@samba.org> | 2014-02-24 12:23:49 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2014-04-23 22:33:08 +0200 |
commit | 29603d1cd9072bf32adfe13ee3d764fd13d12bd0 (patch) | |
tree | f75503cedea76fe50fc46c70c21d3c3fdb3baaeb /source3/lib/messages.c | |
parent | 3e24e07467962436fa505f3b8e591f1af6cafdc0 (diff) | |
download | samba-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/lib/messages.c')
-rw-r--r-- | source3/lib/messages.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source3/lib/messages.c b/source3/lib/messages.c index 4ff933dc6e7..983fe699ed9 100644 --- a/source3/lib/messages.c +++ b/source3/lib/messages.c @@ -197,10 +197,10 @@ struct messaging_context *messaging_init(TALLOC_CTX *mem_ctx, ctx->id = procid_self(); ctx->event_ctx = ev; - status = messaging_tdb_init(ctx, ctx, &ctx->local); + status = messaging_dgm_init(ctx, ctx, &ctx->local); if (!NT_STATUS_IS_OK(status)) { - DEBUG(2, ("messaging_tdb_init failed: %s\n", + DEBUG(2, ("messaging_dgm_init failed: %s\n", nt_errstr(status))); TALLOC_FREE(ctx); return NULL; @@ -245,9 +245,9 @@ NTSTATUS messaging_reinit(struct messaging_context *msg_ctx) msg_ctx->id = procid_self(); - status = messaging_tdb_init(msg_ctx, msg_ctx, &msg_ctx->local); + status = messaging_dgm_init(msg_ctx, msg_ctx, &msg_ctx->local); if (!NT_STATUS_IS_OK(status)) { - DEBUG(0, ("messaging_tdb_init failed: %s\n", + DEBUG(0, ("messaging_dgm_init failed: %s\n", nt_errstr(status))); return status; } |