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/include/messages.h | |
parent | 3e24e07467962436fa505f3b8e591f1af6cafdc0 (diff) | |
download | samba-29603d1cd9072bf32adfe13ee3d764fd13d12bd0.tar.gz |
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/include/messages.h')
-rw-r--r-- | source3/include/messages.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/source3/include/messages.h b/source3/include/messages.h index 47c5f7a2d9d..94379657242 100644 --- a/source3/include/messages.h +++ b/source3/include/messages.h @@ -91,6 +91,11 @@ struct messaging_backend { void *private_data; }; +NTSTATUS messaging_dgm_init(struct messaging_context *msg_ctx, + TALLOC_CTX *mem_ctx, + struct messaging_backend **presult); +NTSTATUS messaging_dgm_cleanup(struct messaging_context *msg_ctx, pid_t pid); + NTSTATUS messaging_tdb_init(struct messaging_context *msg_ctx, TALLOC_CTX *mem_ctx, struct messaging_backend **presult); |