Skip site navigation (1) Skip section navigation (2)

Re: Psql or test application hangs when interface is down for the DB server

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Gregory Stark <stark(at)enterprisedb(dot)com>
Cc: "K\, Niranjan \(NSN - IN\/Bangalore\)" <niranjan(dot)k(at)nsn(dot)com>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: Psql or test application hangs when interface is down for the DB server
Date: 2008-07-16 14:33:07
Message-ID: 7848.1216218787@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-bugs
Gregory Stark <stark(at)enterprisedb(dot)com> writes:
> "K, Niranjan (NSN - IN/Bangalore)" <niranjan(dot)k(at)nsn(dot)com> writes:
>> Is there any other workaround or alternative so that the situation about
>> the interface is down is known and based on that the 'PQexec' does not
>> get blocked for ~15 minutes.

> Absent threads I think you have to use alarm() and a SIGALRM signal handler.

On most modern platforms you can adjust the TCP timeouts for the
connection.  There's no explicit support for that in libpq, but
you can just get the socket FD from it and do setsockopt().

			regards, tom lane

In response to

Responses

pgsql-bugs by date

Next:From: Valentin BogdanovDate: 2008-07-16 14:52:50
Subject: Re: Psql or test application hangs when interface is down for the DB server
Previous:From: Gregory StarkDate: 2008-07-16 09:41:52
Subject: Re: Psql or test application hangs when interface is down for the DB server

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group