Re: The return value of allocate_recordbuf() - Mailing list pgsql-hackers

From Andres Freund
Subject Re: The return value of allocate_recordbuf()
Date
Msg-id 20150108123910.GC12509@alap3.anarazel.de
Whole thread Raw
In response to Re: The return value of allocate_recordbuf()  (Michael Paquier <michael.paquier@gmail.com>)
List pgsql-hackers
Hi,

On 2015-01-05 14:18:35 +0900, Michael Paquier wrote:
> Note that for 9.4, I think that we should complain about an OOM in
> logical.c where malloc is used as now process would simply crash if
> NULL is returned by XLogReaderAllocate. That's the object of the
> second patch.

Yes, that's clearly an oversight...

>      ctx->reader = XLogReaderAllocate(read_page, ctx);
> +    if (!ctx->reader)
> +        ereport(ERROR,
> +                (errcode(ERRCODE_OUT_OF_MEMORY),
> +                 errmsg("out of memory"),
> +                 errdetail("Failed while allocating an XLog reading processor.")));
> +

I've removed the errdetail() as a) its content is quite confusing b) we
don't add error details that don't add more information than the
function name already does as it's implicitly included in the logging.

Greetings,

Andres Freund

-- Andres Freund                       http://www.2ndQuadrant.com/PostgreSQL Development, 24x7 Support, Training &
Services



pgsql-hackers by date:

Previous
From: Dean Rasheed
Date:
Subject: Re: Possible typo in create_policy.sgml
Next
From: Andres Freund
Date:
Subject: Re: Escaping from blocked send() reprised.