Re: Strange hanging bug in a simple milter - Mailing list pgsql-hackers

From Andres Freund
Subject Re: Strange hanging bug in a simple milter
Date
Msg-id 20130913183039.GH1330627@alap2.anarazel.de
Whole thread Raw
In response to Re: Strange hanging bug in a simple milter  (Stephen Frost <sfrost@snowman.net>)
List 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



pgsql-hackers by date:

Previous
From: Stephen Frost
Date:
Subject: Re: Strange hanging bug in a simple milter
Next
From: Stephen Frost
Date:
Subject: Re: Strange hanging bug in a simple milter