From a2436b67e5dd47d955a3bea2b83e0693b627ab96 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sat, 17 Jun 2017 08:48:16 +0200 Subject: messaging: Deliver messages only once This survived an autobuild, so no subsystem strictly needs this anymore. In particular the notify subsystem has been rewritten. Why this patch? It removes some complexity from core code, and it reduces the potential memory overconsumption: Right now I'm working on a g_lock_ping_pong test. This test does a lot of messaging_filtered_read_send calls in a tight loop on a nested event context. With the current code we let the messaging_filtered_read code consume the message that arrives, but it also posts it for consumption by the main event context attached to the messaging context with its "classic" callback. This test never comes back to the main event context, so it accumulates more and more self-posted messages. That's just unnecessary, given that due to the successful autobuild nothing but the read1 test makes use of the "multicasting" of messages. Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison Autobuild-User(master): Jeremy Allison Autobuild-Date(master): Wed Jun 21 07:30:39 CEST 2017 on sn-devel-144 --- source3/torture/test_messaging_read.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source3/torture') diff --git a/source3/torture/test_messaging_read.c b/source3/torture/test_messaging_read.c index 43b4367c11d..d3e4079074b 100644 --- a/source3/torture/test_messaging_read.c +++ b/source3/torture/test_messaging_read.c @@ -122,7 +122,7 @@ bool run_messaging_read1(int dummy) goto fail; } - for (i=0; i<3; i++) { + for (i=0; i<2; i++) { if (tevent_loop_once(ev) != 0) { fprintf(stderr, "tevent_loop_once failed\n"); goto fail; @@ -131,8 +131,8 @@ bool run_messaging_read1(int dummy) printf("%u/%u\n", count1, count2); - if ((count1 != 1) || (count2 != 1)){ - fprintf(stderr, "Got %u/%u msgs, expected 1 each\n", + if ((count1 != 1) || (count2 != 0)) { + fprintf(stderr, "Got %u/%u msgs, expected 1/0\n", count1, count2); goto fail; } -- cgit v1.2.1