summaryrefslogtreecommitdiff
path: root/source3/lib/messages.c
AgeCommit message (Collapse)AuthorFilesLines
2013-02-22messages: Use uint8_t type.Andreas Schneider1-2/+2
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2013-02-19s3:lib: s/struct event_context/struct tevent_contextStefan Metzmacher1-1/+1
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
2012-08-24s3:lib: make sure we don't try to send messages to server_id's marked as ↵Stefan Metzmacher1-0/+4
disconnected metze Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Fri Aug 24 15:54:48 CEST 2012 on sn-devel-104
2012-03-29s3: Fix a valgrind errorVolker Lendecke1-1/+8
Autobuild-User: Volker Lendecke <vl@samba.org> Autobuild-Date: Thu Mar 29 15:50:13 CEST 2012 on sn-devel-104
2012-01-24s3: Add debug when a message is registeredVolker Lendecke1-0/+4
We've always had the corresponding deregister message Autobuild-User: Volker Lendecke <vlendec@samba.org> Autobuild-Date: Tue Jan 24 15:27:51 CET 2012 on sn-devel-104
2012-01-17s3:lib/messages: remove unused messaging_event_context()Stefan Metzmacher1-5/+0
metze Autobuild-User: Stefan Metzmacher <metze@samba.org> Autobuild-Date: Tue Jan 17 09:45:30 CET 2012 on sn-devel-104
2011-12-12s3: Remove a bunch of calls to procid_self()Volker Lendecke1-5/+3
All callers to messaging_[re]init only used procid_self()
2011-10-31s3: Fix some nonempty blank linesVolker Lendecke1-5/+5
Autobuild-User: Volker Lendecke <vlendec@samba.org> Autobuild-Date: Mon Oct 31 14:25:14 CET 2011 on sn-devel-104
2011-10-31s3: Fix a commentVolker Lendecke1-1/+4
2011-10-11s3:messages: convert to use only dbwrap wrapper functionsMichael Adam1-1/+1
Avoid direct use of the db_record and db_context structs.
2011-08-11s3-messaging: Fix messaging classes.Simo Sorce1-8/+11
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>
2011-08-11s3-messaging: Remove obsolete class.Simo Sorce1-2/+0
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>
2011-07-29s3:dbwrap: move all .c and .h files of dbwrap to lib/dbwrap/Michael Adam1-1/+1
Autobuild-User: Michael Adam <obnox@samba.org> Autobuild-Date: Fri Jul 29 13:34:22 CEST 2011 on sn-devel-104
2011-06-09s3-talloc Change TALLOC_ZERO_P() to talloc_zero()Andrew Bartlett1-1/+1
Using the standard macro makes it easier to move code into common, as TALLOC_ZERO_P isn't standard talloc.
2011-06-06s3: Fix two debug messagesVolker Lendecke1-2/+2
Autobuild-User: Volker Lendecke <vlendec@samba.org> Autobuild-Date: Mon Jun 6 14:11:06 CEST 2011 on sn-devel-104
2011-05-05More const fixes for compiler warnings from the waf build.Jeremy Allison1-1/+1
2011-03-30s3-messages: make ndr_messaging.h part of messages.h.Günther Deschner1-2/+0
Guenther
2011-03-30s3-messages: only include messages.h where needed.Günther Deschner1-0/+1
Guenther
2011-03-02s3-server_id: only include server_id where needed.Günther Deschner1-0/+1
Guenther
2010-11-14Move error reporting of messaging context creation fail intoJeremy Allison1-2/+2
the daemons themselves. Allows client utilities to silently fail to create a messaging context due to access denied on the messaging tdb (which I need for the following patch). Jeremy.
2010-08-31s3: messaging_ctdbd_init potentially modifies my_vnnVolker Lendecke1-0/+1
If we call messaging_ctdbd_connection() we end up with the wrong vnn in our messaging context. This is a bit of a hack, get_my_vnn() needs to go eventually along with procid_self()
2010-08-28s3: Fix a typoVolker Lendecke1-1/+1
2010-08-26s3-build: use dbwrap.h only where needed.Günther Deschner1-0/+1
Guenther
2010-07-05s3: Add messaging_server_idVolker Lendecke1-0/+5
2010-07-04s3: Re-initialize the server_id in messaging_reinitVolker Lendecke1-1/+4
2010-03-10s3: Fix a long-standing problem with recycled PIDsVolker Lendecke1-14/+7
When a samba server process dies hard, it has no chance to clean up its entries in locking.tdb, brlock.tdb, connections.tdb and sessionid.tdb. For locking.tdb and brlock.tdb Samba is robust by checking every time we read an entry from the database if the corresponding process still exists. If it does not exist anymore, the entry is deleted. This is not 100% failsafe though: On systems with a limited PID space there is a non-zero chance that between the smbd's death and the fresh access, the PID is recycled by another long-running process. This renders all files that had been locked by the killed smbd potentially unusable until the new process also dies. This patch is supposed to fix the problem the following way: Every process ID in every database is augmented by a random 64-bit number that is stored in a serverid.tdb. Whenever we need to check if a process still exists we know its PID and the 64-bit number. We look up the PID in serverid.tdb and compare the 64-bit number. If it's the same, the process still is a valid smbd holding the lock. If it is different, a new smbd has taken over. I believe this is safe against an smbd that has died hard and the PID has been taken over by a non-samba process. This process would not have registered itself with a fresh 64-bit number in serverid.tdb, so the old one still exists in serverid.tdb. We protect against this case by the parent smbd taking care of deregistering PIDs from serverid.tdb and the fact that serverid.tdb is CLEAR_IF_FIRST. CLEAR_IF_FIRST does not work in a cluster, so the automatic cleanup does not work when all smbds are restarted. For this, "net serverid wipe" has to be run before smbd starts up. As a convenience, "net serverid wipedbs" also cleans up sessionid.tdb and connections.tdb. While there, this also cleans up overloading connections.tdb with all the process entries just for messaging_send_all(). Volker
2009-03-10fixed a bug in message handling for code the change notify codeAndrew Tridgell1-2/+16
The change notify code registered a separate message handler for each tree connect. This registration uses the global messaging context. The messaging code would consider a 2nd registration for the same messaging type as being an 'update' of the handler, rather than a new handler. It also would only call the first handler in the linked list for a given message type when dispatching messages. This patch changes the messaging code to allow for multiple registrations of the same message type, and allow for multiple calls to different messaging handler for one incoming message. This fixes the problem with the test_notify_tcon() test that I recently committed to the S4 smbtorture
2009-01-20s3:messaging: also recreate the local messaging backend in messaging_reinit()Stefan Metzmacher1-3/+11
This prepares the change to use signal events in the tdb backend. metze
2008-06-26messages: bump debug level to 1 for "messaging_ctdb_init failed".Michael Adam1-2/+2
Leave level 0 messages to higher level callers. Michael (This used to be commit 7bbf29137bf051044cbf0db8d9fe564a7c9d7a29)
2008-04-12messaging: add FLAG_MSG_DBWRAP message class flagStefan Metzmacher1-0/+2
metze (This used to be commit ee6325495f48bab43a37d740a6eca57192004d57)
2007-10-18RIP BOOL. Convert BOOL -> bool. I found a few interestingJeremy Allison1-1/+1
bugs in various places whilst doing this (places that assumed BOOL == int). I also need to fix the Samba4 pidl generation (next checkin). Jeremy. (This used to be commit f35a266b3cbb3e5fa6a86be60f34fe340a3ca71f)
2007-10-10r24032: It helps testing tremendously if the cluster messaging actually sendsVolker Lendecke1-0/+7
and receives messages to other nodes... :-) (This used to be commit 3e9e9a3f28763500a1c5e551a808a14661d7d9fa)
2007-10-10r23784: use the GPLv3 boilerplate as recommended by the FSF and the license textAndrew Tridgell1-2/+1
(This used to be commit b0132e94fc5fef936aa766fb99a306b3628e9f07)
2007-10-10r23779: Change from v2 or later to v3 or later.Jeremy Allison1-1/+1
Jeremy. (This used to be commit 407e6e695b8366369b7c76af1ff76869b45347b3)
2007-10-10r23410: Merge the core of the cluster code.Volker Lendecke1-0/+41
I'm 100% certain I've forgotten to merge something, but the main code should be in. It's mainly in dbwrap_ctdb.c, ctdbd_conn.c and messages_ctdbd.c. There should be no changes to the non-cluster case, it does survive make test on my laptop. It survives some very basic tests with ctdbd enables, I did not do the full test suite for clusters yet. Phew... Volker (This used to be commit 15553d6327a3aecdd2b0b94a3656d04bf4106323)
2007-10-10r23343: Fix error returnVolker Lendecke1-1/+3
(This used to be commit 0014ee44b87a4a109c897ffec5f9c38eea442571)
2007-10-10r23204: Add MSG_SMB_BRL_VALIDATE. Tridge, this is a bit different from your bzrVolker Lendecke1-1/+1
branch, please check if it fulfils your needs. Two changes: The validation is not done inside the brlock.c traverse_fn, it's done as a separate routine. Secondly, this patch does not call the checker routines in smbcontrol directly but depends on a running smbd. (This used to be commit 7e39d77c1f90d9025cab08918385d140e20ca25b)
2007-10-10r23171: Convert connections.tdb to dbwrapVolker Lendecke1-14/+8
(This used to be commit 80a1f43825063bbbda896175d99700ede5a4757a)
2007-10-10r23117: Factor out local messaging.Volker Lendecke1-399/+26
This removes message_block / message_unblock. I've talked to Jeremy and Günther, giving them my reasons why I believe they have no effect. Neither could come up with a counter-argument, so they go :-) (This used to be commit a925e0991ffbaea4a533bab3a5d61e5d367d46c8)
2007-10-10r23112: Trim down the message.c API slightly: The messages_pending_for_pid ↵Volker Lendecke1-56/+41
is now replaced by MSG_FLAG_LOWPRIORITY or'ed into the msg_type. To enable this, changed the msg_type definitions to hexadecimal. This way we could theoretically add the MSG_FLAG_NODUPLICATES again, but I would rather not do this, because that one is racy and can't be guaranteed at all. (This used to be commit 3f5eb8a9600839a9f9c44c553f0bda6df22b30b0)
2007-10-10r23077: Minor cleanupVolker Lendecke1-4/+0
(This used to be commit 72ed8388252bed07627b3a4636744dc8acf1c98b)
2007-10-10r23055: Rewrite messages.c to use auto-generated marshalling in the tdb. I'mVolker Lendecke1-330/+267
doing this because for the clustering the marshalling is needed in more than one place, so I wanted a decent routine to marshall a message_rec struct which was not there before. Tridge, this seems about the same speed as it used to be before, the librpc/ndr overhead in my tests was under the noise. Volker (This used to be commit eaefd00563173dfabb7716c5695ac0a2f7139bb6)
2007-10-10r23025: Some logic simplificationsVolker Lendecke1-29/+27
(This used to be commit d3f16722b2c3c68b03e55b5100d979921c3f284d)
2007-10-10r23024: Ok, neither the duplicates_allowed nor the timeout argument toVolker Lendecke1-112/+12
message_send_pid is used anymore. Two users of duplicates_allowed: winbind and the printer notify system. I don't thing this really changes semantics: duplicates_allowed is hell racy anyway, we can't guarantee that we don't send the same message in sequence twice, and I think the only thing we can harm with the print notify is performance. For winbind I talked to Günther, and he did not seem too worried. Volker (This used to be commit 75b3ae6a761c33ae6a70799340a1e8c1edea265e)
2007-10-10r23023: Get rid of the only caller of message_send_pid_with_timeout(). This ↵Volker Lendecke1-10/+0
replaces the timeouts on the individual message send calls with an overall timeout on all the calls. The timeout in message_send_pid_with_timeout() did not make much sense IMO anyway, because the tdb_fetch() for the messages_pending_for_pid was blocking in a readlock anyway, we "just" did the timeout for the write lock. This new code goes through the full wait for the write lock once and then breaks out of sending the notifies instead of running into the timeout per target. Jerry, please check this! Thanks, Volker (This used to be commit 697099f06e1aa432187f802b9c2632607e3de46e)
2007-10-10r23022: ReformattingVolker Lendecke1-37/+47
(This used to be commit 782ee7291683d061767688b23f93ac0865e46331)
2007-10-10r23015: Make message_(de)register static to messages.cVolker Lendecke1-7/+13
(This used to be commit a8082a3c7c3d1e68c27fc3bf42f3d44402cc6f9f)
2007-10-10r22934: Change smbcontrol to use messaging_register instead of message_registerVolker Lendecke1-0/+7
(This used to be commit e3d985c581ffc597aea932858d27c421643d2868)
2007-10-10r22911: Pass a messaging_context to message_send_allVolker Lendecke1-1/+2
(This used to be commit cc92ce665dcfe9054d09429219883b18a4cab090)
2007-10-10r22910: Make message_send_pid static to messages.cVolker Lendecke1-16/+9
(This used to be commit 27224922cf964cc70aad7cf529ab6c03fb277a89)