Re: PQconnectStart() and -EINTR

From: Doug McNaught <doug(at)wireboard(dot)com>
To: David Ford <david(at)blue-labs(dot)org>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: PQconnectStart() and -EINTR
Date: 2001-10-24 16:27:37
Message-ID: m3hespatqe.fsf@belphigor.mcnaught.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

David Ford <david(at)blue-labs(dot)org> writes:

> I've got a bit of a problem. I added a fast SIGALRM handler in my project to
> do various maintenance and this broke PQconnectStart().
>
>
> Oct 23 21:56:36 james BlueList: connectDBStart() -- connect() failed:
> Interrupted system call ^IIs the postmaster running (with -i) at
> 'archives.blue-labs.org' ^Iand accepting connections on TCP/IP port 5432?
>
>
> PQstatus() returns CONNECTION_BAD, how can I reenter the connection cycle or
> delay, more like, how do I differentiate between an actual failure to connect
> and an interruption by signal? My alarm timer happens much too frequently for
> this code to make a connection and unfortunately I can't disable the alarm
> because it's used for bean counting and other maintenance.

Sounds like something in libpq needs to check for EINTR and reissue the
connect() call (or select()/poll() if it's a nonblocking connect()).

-Doug
--
Let us cross over the river, and rest under the shade of the trees.
--T. J. Jackson, 1863

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2001-10-24 16:59:45 Re: storing binary data
Previous Message Antonio Sergio de Mello e Souza 2001-10-24 15:51:53 Index on wide column