From 37fdb858b069d862d53edae11dff42a4696c78a4 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 5 Jun 2005 07:44:51 +0000 Subject: r7298: ensure messages are sent in order even when under extreme load. This fixes a IO_TIMEOUT problem in the messaging benchmarks (This used to be commit c8b220b65de00418d19347cf298cc80d86e8accb) --- source4/lib/messaging/irpc.h | 2 +- source4/lib/messaging/messaging.c | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/source4/lib/messaging/irpc.h b/source4/lib/messaging/irpc.h index 93cadddd34..99a2d60f35 100644 --- a/source4/lib/messaging/irpc.h +++ b/source4/lib/messaging/irpc.h @@ -28,7 +28,7 @@ struct irpc_message { }; /* don't allow calls to take too long */ -#define IRPC_CALL_TIMEOUT 20 +#define IRPC_CALL_TIMEOUT 10 /* the server function type */ diff --git a/source4/lib/messaging/messaging.c b/source4/lib/messaging/messaging.c index 4c4b6ea8da..823058b0cf 100644 --- a/source4/lib/messaging/messaging.c +++ b/source4/lib/messaging/messaging.c @@ -308,7 +308,12 @@ NTSTATUS messaging_send(struct messaging_context *msg, uint32_t server, rec->path = messaging_path(msg, server); talloc_steal(rec, rec->path); - status = try_send(rec); + if (msg->pending != NULL) { + status = STATUS_MORE_ENTRIES; + } else { + status = try_send(rec); + } + if (NT_STATUS_EQUAL(status, STATUS_MORE_ENTRIES)) { if (msg->pending == NULL) { EVENT_FD_WRITEABLE(msg->event.fde); -- cgit