Thread: hanging processes

hanging processes

From
"Merlin Moncure"
Date:
I think this is windows specific but it might now be.

With a win32 server & XP clients, if the client is killed with a hard
reset i.e. pull out power cord, the server does not recognize that the
connection has been broken in pg_stat_activity and does not clean up
various things such as user_locks and presumably entries in pg_listener.
A manual kill via pg_ctl is required from that point.

With any 'soft' method of killing the client up to and including killing
the client application process from the client task manager and
everything is normal in that the database logs a unexpected connection
closure and everything is cleaned up.

Is this normal?

Merlin

Re: hanging processes

From
Tom Lane
Date:
"Merlin Moncure" <merlin.moncure@rcsonline.com> writes:
> With a win32 server & XP clients, if the client is killed with a hard
> reset i.e. pull out power cord, the server does not recognize that the
> connection has been broken in pg_stat_activity and does not clean up
> various things such as user_locks and presumably entries in pg_listener.
> A manual kill via pg_ctl is required from that point.

Did you wait for the TCP KEEPALIVE timeout interval?

            regards, tom lane

Re: hanging processes

From
"Magnus Hagander"
Date:
> > With a win32 server & XP clients, if the client is killed
> with a hard
> > reset i.e. pull out power cord, the server does not
> recognize that the
> > connection has been broken in pg_stat_activity and does not
> clean up
> > various things such as user_locks and presumably entries in
> pg_listener.
> > A manual kill via pg_ctl is required from that point.
>
> Did you wait for the TCP KEEPALIVE timeout interval?

Which, if you didn't know it already, is two hours on Windows.

//Magnus

Re: hanging processes

From
"Merlin Moncure"
Date:
> "Merlin Moncure" <merlin.moncure@rcsonline.com> writes:
> > With a win32 server & XP clients, if the client is killed with a
hard
> > reset i.e. pull out power cord, the server does not recognize that
the
> > connection has been broken in pg_stat_activity and does not clean up
> > various things such as user_locks and presumably entries in
pg_listener.
> > A manual kill via pg_ctl is required from that point.
>
> Did you wait for the TCP KEEPALIVE timeout interval?

Apparently not.  Timeout on windows is 2 hours which is pretty standard
I guess.  I'm going to research into tweaking it down.

Merlin