Re: Strange hanging bug in a simple milter

From: Andres Freund <andres(at)2ndquadrant(dot)com>
To: Stephen Frost <sfrost(at)snowman(dot)net>
Cc: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>, Vesa-Matti J Kari <vmkari(at)cc(dot)helsinki(dot)fi>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Strange hanging bug in a simple milter
Date: 2013-09-13 18:30:39
Message-ID: 20130913183039.GH1330627@alap2.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2013-09-13 13:59:54 -0400, Stephen Frost wrote:
> Unfortunately, while I can still easily get the deadlock to happen when
> the hooks are reset, the hooks don't appear to ever get called when
> ssl_open_connections is set to zero. You have a good point about the
> additional SSL calls after the hooks are unloaded though, I wonder if
> holding the ssl_config_mutex lock over all of close_SSL might be more
> sensible..

Hm. You might want to do the check for ssl_open_connections after a
memory barrier or such, it might not actually be up2date (too tired to
think about the actual guarantees of x86's cache coherency guarantees).

Does it burn if you move the pqsecure_destroy(); to the end of the
function, after setting a boolean in the if (conn->ssl) branch?

Greetings,

Andres Freund

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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Stephen Frost 2013-09-13 18:33:25 Re: Strange hanging bug in a simple milter
Previous Message Stephen Frost 2013-09-13 17:59:54 Re: Strange hanging bug in a simple milter