summaryrefslogtreecommitdiffstats
path: root/source3/include/messages.h
Commit message (Collapse)AuthorAgeFilesLines
* messaging3: Add messaging_handler_send/recvVolker Lendecke2014-12-161-0/+8
| | | | | | | | | This repeatedly listens on msg_type. It's similar to messaging_register with talloc based autocleanup. The handler is free to talloc_move a way the record for later use. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* messaging3: Add messaging_send_iov_fromVolker Lendecke2014-12-161-0/+5
| | | | | | | In the notifyd code it will be very helpful to fake source server_ids Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* messaging3: Add messaging_names_dbVolker Lendecke2014-12-161-0/+1
| | | | | | | | This will enable messaging3 users to more easily register themselves under a name Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:messaging: explain why the messaging_send*() functions need a tevent-loop.Michael Adam2014-09-301-0/+10
| | | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* s3:messaging: add fds-array to messaging_send_iov()Michael Adam2014-09-241-1/+2
| | | | | | Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org> Signed-off-by: Michael Adam <obnox@samba.org>
* s3:messaging: add fds-array to message-backend send functionMichael Adam2014-09-241-0/+1
| | | | | | Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org> Signed-off-by: Michael Adam <obnox@samba.org>
* messaging3: Include messages_dgm.h only in messages.cVolker Lendecke2014-08-121-1/+0
| | | | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Tue Aug 12 02:21:32 CEST 2014 on sn-devel-104
* messaging3: Add messages_dgm.hVolker Lendecke2014-08-111-23/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* messaging3: Pass dir_owner to messaging_dgm_init()Volker Lendecke2014-08-111-0/+1
|
* messaging3: Pass cache_dir to messaging_dgm_init()Volker Lendecke2014-08-111-0/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* messaging3: Directly refer to messaging_dgm in messages.cVolker Lendecke2014-08-111-7/+9
| | | | | | | | | | | | | This removes the messaging_backend abstraction layer from messages_dgm.c. That layer was introduced for ctdb and is still used there. But as the messaging_dgm interface is very slim anyway, I don't think directly calling it is too bad. Why this commit? It is another step towards making messages_dgm independent of messages.[ch], thus it might become usable in other contexts like ctdb and source4 Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* messaging3: Add messaging_cleanupVolker Lendecke2014-08-111-0/+2
| | | | | | | | Rename smbcontrol's dgm-cleanup to msg-cleanup. We haven't published this UI yet :-) Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* messaging_dgm: Remove unused "messaging_context"Volker Lendecke2014-08-111-2/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* messaging3: Explicitly pass server_id to messaging_dgm_initVolker Lendecke2014-08-111-0/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* messaging3: Explicitly pass tevent_context to messaging_dgm_initVolker Lendecke2014-08-111-0/+1
| | | | | | | One dependency less on messaging_context() Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* messaging_dgm: Receive through a cb functionVolker Lendecke2014-08-111-1/+8
| | | | | | | This avoids calling messaging_dispatch_rec directly from messaging_dgm.c Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* messaging3: Make messaging_dgm_init return 0/errnoVolker Lendecke2014-06-181-3/+3
| | | | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Wed Jun 18 21:17:57 CEST 2014 on sn-devel-104
* messaging3: Make messaging_dgm_wipe return 0/errnoVolker Lendecke2014-06-181-1/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* messaging3: Make messaging_dgm_cleanup return 0/errnoVolker Lendecke2014-06-181-1/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* messaging3: Make the _send function return 0/errnoVolker Lendecke2014-06-181-4/+4
| | | | | | | This is to eventually make messaging_dgm usable in ctdb Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* messaging3: Make messaging_context privateVolker Lendecke2014-05-311-21/+0
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* messaging3: Add and use messaging_tevent_context()Volker Lendecke2014-05-311-0/+2
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* messaging3: Introduce messaging_local_backend()Volker Lendecke2014-05-311-0/+2
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* messaging3: The backend send_fn doesn't need a messaging_contextVolker Lendecke2014-05-311-1/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:messaging: change messaging_backend to use iovec instead of data blob in ↵Michael Adam2014-05-301-1/+1
| | | | | | | | | | | | | | | send_fn This also changes the layering messaging_send_iov -> messaging_send_buf -> messaging_send to messaging_send_buf -> messaging_send -> messaging_send_iov Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* messaging3: Add messaging_dgm_register_tevent_contextVolker Lendecke2014-05-081-0/+3
| | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* messaging3: Add messaging_filtered_readVolker Lendecke2014-05-081-0/+8
| | | | | | | | This delegates the decision whether to read a message to a callback Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* messaging3: Fix messaging_read_send/recvVolker Lendecke2014-04-301-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | messaging_read_send/recv was okay for just one handler in the queue. For multiple handlers it was pretty broken. A handler that deletes itself as part of the callback (pretty typical use case...) drops the message for a subsequent handler that responds to the same message type. In messaging_dispatch_rec we walk the array, however messaging_read_cleanup has already changed the array. tevent_req_defer_callback does not help here: It only defers the callback, it does not defer the cleanup function. This also happens when a callback deletes a different handler A handler that re-installs itself in the callback might get a message twice. This patch changes the code such that only messaging_dispatch_rec adds records to msg_ctx->waiters, new waiters are put into a staging area first (msg_ctx->new_waiters). Also messaging_read_cleanup does not move anything around in msg_ctx->waiters, it only nulls out itself. messaging_dispatch_rec is changed to cope with this. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3: messaging: Add infrastructure to clean up orphaned sockets every 15 ↵Volker Lendecke2014-04-231-0/+2
| | | | | | | minutes as a background task. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* messaging_dgm: Add messaging_dgm_wipeVolker Lendecke2014-04-231-0/+1
| | | | | | | This walks all sockets and wipes the left-overs Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* messaging3: Add messaging_send_iovVolker Lendecke2014-04-231-0/+3
| | | | | | | | This uses a copy, will be replaced by a direct iovec call through to sendmsg on the unix domain socket Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* lib: Remove messages_localVolker Lendecke2014-04-231-12/+0
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* lib: Add messaging_dgmVolker Lendecke2014-04-231-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* s3: messages: Implement cleanup of dead records.Jeremy Allison2014-04-031-0/+6
| | | | | | | | | | | | When a smbd process dies, pending messages.tdb records for this process might not get cleaned up. Implement a cleanup for dead records that is triggered after a smbd dies uncleanly; the records for that PID are deleted. Based on a patchset from Christof Schmitt <cs@samba.org>. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Christof Schmitt <cs@samba.org>
* s3:build: remove global CLUSTER_SUPPORT defineStefan Metzmacher2014-03-241-4/+0
| | | | | | | | | | All ctdb specific code is isolated in samba-cluster-support.so now. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Autobuild-User(master): Michael Adam <obnox@samba.org> Autobuild-Date(master): Mon Mar 24 19:08:44 CET 2014 on sn-devel-104
* messaging3: Remove unused messaging_tdb_eventVolker Lendecke2014-01-211-3/+0
| | | | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Tue Jan 21 10:07:21 CET 2014 on sn-devel-104
* messaging3: Add messaging_read_send/recvVolker Lendecke2014-01-211-0/+10
| | | | | | | | | | | | | | | | | | | This is made to replace the msg_channel abstraction. msg_channel was created to not miss any messages. For this, some complex queueing was installed. This complexity has caused quite a few problems in the past (see bug 10284 for example). messaging_read_send/recv is able to achieve the same goal with a lot less complexity. The messaging_read_send atomically installs the reader into the messaging_context, we will not miss any messages while this installed. messaging_send_recv will deinstall that listener, but in the callback function you can directly call messaging_read_send again without going through the tevent_loop_once. As long as this is always made sure, no messages will be lost. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:include: fix messaging_send_buf() protype in messages.hStefan Metzmacher2013-10-171-1/+1
| | | | | | | | The function already used 'uint8_t' instead of 'uint8'. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s3:lib: s/struct event_context/struct tevent_contextStefan Metzmacher2013-02-191-2/+2
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* s3: Add messaging_tdb_event()Volker Lendecke2012-04-171-0/+3
| | | | | | | | This is a void* that represents a signal handler attached to some custom tevent_context. This is necessary to make the tdb based messaging infrastructure trigger its business when we are sitting in tevent_loop_once for an event context that is not the main one in the messaging context.
* s3:lib/messages: remove unused messaging_event_context()Stefan Metzmacher2012-01-171-1/+0
| | | | | | | metze Autobuild-User: Stefan Metzmacher <metze@samba.org> Autobuild-Date: Tue Jan 17 09:45:30 CET 2012 on sn-devel-104
* s3: Remove a bunch of calls to procid_self()Volker Lendecke2011-12-121-3/+1
| | | | All callers to messaging_[re]init only used procid_self()
* s3: factor out messaging_send_to_children()Gregor Beck2011-10-121-0/+1
| | | | Signed-off-by: Michael Adam <obnox@samba.org>
* s3: Fix some nonempty blank linesVolker Lendecke2011-09-131-3/+3
|
* s3-messaging: Change classification of MSG_SMB_CONF_UPDATED.Simo Sorce2011-08-111-1/+0
| | | | | | | | smbd is not the only daemon interested in smb.conf changes. Move this message to the GENERAL class so that all interested partied (nmbd, winbindd, spoolssd, etc..) can receive this notification. Signed-off-by: Andreas Schneider <asn@samba.org>
* s3-messaging: Fix messaging classes.Simo Sorce2011-08-111-1/+1
| | | | | | | | | | | | This has been broken since ff0ac5b0 (May 2007). Basically all messages were belonging to the General class except for CTDB messages. This fixed the message_send_all() function to correctly compute the class, and fixes registrations to include all they need to cope with the fact not all messages are of calss general (registrations rotted a bit because as long as FLAG_MSG_GENERAL was defined the process woould receive all messages). Signed-off-by: Andreas Schneider <asn@samba.org>
* s3-messaging: Remove obsolete class.Simo Sorce2011-08-111-1/+1
| | | | | | | The FLAG_MSG_PRINT_NOTIFY class is actually obsolete and never used, as the only message belonging to it is not used either. Signed-off-by: Andreas Schneider <asn@samba.org>
* lib/util Bring procid_str() into lib/util as server_id_string()Andrew Bartlett2011-06-091-7/+0
| | | | | | | This is needed for OpenChange, which prints Samba struct server_id values in debug messages. Andrew Bartlett
* s3-messages: make ndr_messaging.h part of messages.h.Günther Deschner2011-03-301-0/+2
| | | | Guenther
* s3: add server_id.idl and use only autogenerated code.Günther Deschner2011-02-171-8/+1
| | | | | | | | | Volker, Tridge and other clustering gurus, please check. It is ok to get rid of ifdef CLUSTER_SUPPORT here, right ? Why was unique_id not marshalled at all ? Guenther