Relax an out of memory message.
authorMartin Schwenke <martin@meltin.net>
Wed, 16 Nov 2011 04:25:14 +0000 (15:25 +1100)
committerMartin Schwenke <martin@meltin.net>
Wed, 16 Nov 2011 04:46:44 +0000 (15:46 +1100)
The call to ctdb_transport_allocate() can fail for 2 reasons:

* Unable to allocate memory.

* The transport is down, perhaps because CTDB is shutting down.

Either cause will be appropriately logged.

The current use of CTDB_NO_MEMORY_VOID() prints an "out of memory"
message regardless of what happened in ctdb_transport_allocate() and
this could be misleading.

Change this to print a more relaxed message.

Signed-off-by: Martin Schwenke <martin@meltin.net>
server/ctdb_control.c

index 9c2f7429dd290e57eb81b6636cb81397f9d2b468..667083cf73696820ebb560dd3287f57716eefa72 100644 (file)
@@ -648,7 +648,10 @@ void ctdb_request_control_reply(struct ctdb_context *ctdb, struct ctdb_req_contr
                len += strlen(errormsg);
        }
        r = ctdb_transport_allocate(ctdb, ctdb, CTDB_REPLY_CONTROL, len, struct ctdb_reply_control);
-       CTDB_NO_MEMORY_VOID(ctdb, r);
+       if (r == NULL) {
+               DEBUG(DEBUG_ERR,(__location__ "Unable to allocate transport - OOM or transport is down\n"));
+               return;
+       }
 
        r->hdr.destnode     = c->hdr.srcnode;
        r->hdr.reqid        = c->hdr.reqid;