From ca7e02fd3708a048cd691e6c2fc0357ffcc3b694 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 17 Oct 2004 22:28:26 +0000 Subject: r3026: - added automatic retry to messages when the servers listen queue is full. This means callers can just "send and forget" rather than having to check for a temporary failure. The mechanism takes nice advantage of the timed events handling is our events code. A message will only fail now if we completely run out of some resource (such as memory). - changed the test code not to do retries itself, but only to warn on real failures (This used to be commit 8cddc610a25e64c1ad39dd6a2fc2e7f467e04fc9) --- source4/torture/local/messaging.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'source4/torture/local/messaging.c') diff --git a/source4/torture/local/messaging.c b/source4/torture/local/messaging.c index d4aaf80f4f..6177bc82a8 100644 --- a/source4/torture/local/messaging.c +++ b/source4/torture/local/messaging.c @@ -28,9 +28,10 @@ static void ping_message(void *msg_ctx, void *private, uint32_t msg_type, servid_t src, DATA_BLOB *data) { NTSTATUS status; - do { - status = messaging_send(msg_ctx, src, MY_PONG, data); - } while (NT_STATUS_EQUAL(status, STATUS_MORE_ENTRIES)); + status = messaging_send(msg_ctx, src, MY_PONG, data); + if (!NT_STATUS_IS_OK(status)) { + printf("pong failed - %s\n", nt_errstr(status)); + } } static void pong_message(void *msg_ctx, void *private, @@ -85,15 +86,17 @@ static BOOL test_ping_speed(TALLOC_CTX *mem_ctx) status1 = messaging_send(msg_ctx, 1, MY_PING, &data); status2 = messaging_send(msg_ctx, 1, MY_PING, NULL); - if (NT_STATUS_IS_OK(status1)) { - ping_count++; + if (!NT_STATUS_IS_OK(status1)) { + printf("msg1 failed - %s\n", nt_errstr(status1)); } - if (NT_STATUS_IS_OK(status2)) { - ping_count++; + if (!NT_STATUS_IS_OK(status2)) { + printf("msg2 failed - %s\n", nt_errstr(status2)); } - while (ping_count > pong_count + 10) { + ping_count += 2; + + while (ping_count > pong_count + 20) { event_loop_once(ev); } } -- cgit