Re: Strange hanging bug in a simple milter

Поиск
Список
Период
Сортировка
От Heikki Linnakangas
Тема Re: Strange hanging bug in a simple milter
Дата
Msg-id 522DB7F3.2010203@vmware.com
обсуждение исходный текст
Ответ на Strange hanging bug in a simple milter  (Vesa-Matti J Kari <vmkari@cc.helsinki.fi>)
Ответы Re: Strange hanging bug in a simple milter  (Vesa-Matti J Kari <vmkari@cc.helsinki.fi>)
Список pgsql-hackers
On 09.09.2013 09:34, Vesa-Matti J Kari wrote:
> Basically all that the authmilter now does is to connect to PostgreSQL in
> authmilt_connect() and close the connection in authmilt_close(). Based on
> the authmilter debug logging it seems to me that when the hanging occurs,
> the authmilter never completes PQsetdbLogin().
>
> Based on the document
>
>    http://www.postgresql.org/docs/9.1/interactive/libpq-threading.html
>
> I am sure libpq should be thread safe and on startup
> the authmilter verifies that the libpq is indeed thread safe.
>
>
> If you think you could set up a test enviroment using:
>
> - Sendmail (or maybe Postfix)
> - authmilter
> - PostgreSQL
>
> here is an authmilter-simplied.tar.gz package for you:
>
>    http://www.helsinki.fi/~vmkari/authmilter-simplified.tar.gz
>
> The README file contains a rough instructions outline on how to setup
> things in order to reproduce the strange hanging bug.
>
>
> Please note that when running two test message sender scripts in parallel,
> the bug does not occur immediately, but only after between 1 to 5 minutes
> of processing. Sometimes it may take even longer.

I managed to set that up and got it running. But it works fine for me, 
does not hang.

I'd suggest poking around with gdb, to see where it hangs. Also, run 
"select * from pg_stat_activity" from a psql session to see what's 
happening inside the database. log_connections=on and 
log_disconnections=on would also be a good idea.

PS. You'll need to escape the strings in the queries, to avoid SQL 
injection.

- Heikki



В списке pgsql-hackers по дате отправления:

Предыдущее
От: "MauMau"
Дата:
Сообщение: Re: [bug fix] strerror() returns ??? in a UTF-8/C database with LC_MESSAGES=non-ASCII
Следующее
От: "MauMau"
Дата:
Сообщение: Is this a correct recommendation for Solaris 10 kernel settings?