RE: PostgreSQL and Unicode - Mailing list pgsql-hackers

From Tatsuo Ishii
Subject RE: PostgreSQL and Unicode
Date
Msg-id 20000516183048I.t-ishii@sra.co.jp
Whole thread Raw
Responses Re: RE: PostgreSQL and Unicode  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
> Regarding the "postmaster processes not going away" problem...
> 
> We're developing a Java application that connects to a PostgreSQL db. During
> our development process we debug the code and sometimes kill the program in
> the middle of the run. Sometimes this means that an open Connection to the
> database is not properly closed. Now, I realize that this is an unfriendly
> thing to do to PG but I would think it would eventually recover. What
> happens instead is that the postmaster/postgres process that was handling
> that connection never terminates. I have seen processes that are more than 2
> weeks old before we noticed and restarted postmaster manually.
> 
> The problem is that eventually PG runs out of connections and stops allowing
> new ones.
> 
> So, is there a way to tell PG to timeout unused connections after some
> specified time? I've looked through all the docs and could not find anything
> like this. I realize that this is a difficult issue because if there is an
> unresolved transaction what do you do with it. I guess all you could do is
> roll it back.
> 
> Any other suggestions? If not, can I request this as a future feature?
> Although our problems are happening during debugging, they could happen
> during deployment given a hardware problem or, *gasp*, a bug in our code.

What about adding KEEPALIVE option to the socket? This would take a
while to detect orphaned socket, though.
--
Tatsuo Ishii


pgsql-hackers by date:

Previous
From: Dave Page
Date:
Subject: ODBC & v7.0(Rel) Errors with Users and Databases
Next
From: Patrick Welche
Date:
Subject: Re: reading row in backend