Re: [HACKERS] Log LDAP "diagnostic messages"? - Mailing list pgsql-hackers

From Thomas Munro
Subject Re: [HACKERS] Log LDAP "diagnostic messages"?
Date
Msg-id CAEepm=03vDdAVraazxHc52CM0V1BJCimYX9Y747KqSqpvGdkiQ@mail.gmail.com
Whole thread Raw
In response to Re: [HACKERS] Log LDAP "diagnostic messages"?  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
Responses Re: [HACKERS] Log LDAP "diagnostic messages"?
List pgsql-hackers
On Wed, Sep 20, 2017 at 7:57 AM, Peter Eisentraut
<peter.eisentraut@2ndquadrant.com> wrote:
> In the 0001 patch, I would move the ldap_unbind() calls after the
> ereport(LOG) calls.  We do all the other resource cleanup (pfree() etc.)
> after the ereport() calls, so it would be weird to do this one
> differently.  Also, in the second patch you move one of the
> ldap_unbind() calls down anyway.

Fair point.  In that case there are a few others we should consider
moving down too for consistency, like in the attached.

> In the 0002 patch, I think this is a bit repetitive and could be
> refactored even more.  The end result could look like
>
>     ereport(LOG,
>             (errmsg("blah"),
>              errdetail_for_ldap(ldap)));
>     ldap_unbind(ldap);

Thanks, that is much tidier.  Done that way in the attached.

Here also is a small addition to your TAP test which exercises the
non-NULL code path because slapd rejects TLS by default with a
diagnostic message.  I'm not sure if this is worth adding, since it
doesn't actually verify that the code path is reached (though you can
see that it is from the logs).

-- 
Thomas Munro
http://www.enterprisedb.com

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Attachment

pgsql-hackers by date:

Previous
From: Alvaro Hernandez
Date:
Subject: Re: [HACKERS] Built-in plugin for logical decoding output
Next
From: Peter Eisentraut
Date:
Subject: Re: [HACKERS] ICU locales and text/char(n) SortSupport on Windows