Re: libpq thread locking during SSL connection start

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Stephen Frost <sfrost(at)snowman(dot)net>
Cc: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: libpq thread locking during SSL connection start
Date: 2013-08-12 13:26:51
Message-ID: 5208E29B.5030105@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 8/1/13 1:42 PM, Stephen Frost wrote:
> * Alvaro Herrera (alvherre(at)2ndquadrant(dot)com) wrote:
>> pgsecure_open_client() returns -1 if it can't lock the mutex. This is a
>> problem because the callers are not prepared for that return value. I
>> think it should return PGRES_POLLING_FAILED instead, after setting an
>> appropriate error message in conn->errorMessage.
>
> Ah, right, adding it there was a bit of a late addition, tbh.

Elsewhere in libpq, we use PGTHREAD_ERROR and abort if
pthread_mutex_lock fails. Shouldn't we handle that consistently?

Alternatively, if we want to just print an error message and proceed, we
should put the strerror based on the return value into the message.

Overall, the response to these kinds of errors doesn't look very well
thought through. (Not to speak of ecpg, which ignores these errors
altogether.)

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2013-08-12 14:11:44 Re: [BUGS] BUG #8335: trim() un-document behaviour
Previous Message ascot.moss@gmail.com 2013-08-12 11:17:49 Re: Replication delay