Re: PrepareStatement.execute() blocked because of long time 'create index' operation, connection leak

From: Vladimir Sitnikov <sitnikov(dot)vladimir(at)gmail(dot)com>
To: Vitalii Tymchyshyn <vit(at)tym(dot)im>, Dave Cramer <pg(at)fastcrypt(dot)com>, "jingzhi(dot)zhang(at)outlook(dot)com" <jingzhi(dot)zhang(at)outlook(dot)com>
Cc: List <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: PrepareStatement.execute() blocked because of long time 'create index' operation, connection leak
Date: 2016-06-07 12:44:45
Message-ID: CAB=Je-Hop9x03hvwLOoeONGtCCRzybw=GDLfGC9bZz0v0tfGSg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Vitalii>But do we already use SO_KEEPALIVE on the socket layer?
Vitalii>Also I am not really sure socket was closed on the server end.
Vitalii> TS said he could see server backend in the idle state. Also backed
server did not fail, so unless there were some network glitch we should
have received tcp reset.

tcpKeepAlive connection setting is false by default. I think it's better to
make "true" the default value.

Sehrope>I don't think it's a good idea to flood the server with dummy
messages for the purposes of keeping the connection alive.
Sehrope>Besides the usual problems of filling up the send buffer, you'd
also have to have it done in a separate thread
Sehrope>as the usual sender is already blocked waiting for the command
response.

Sending a sync message once every 10m will hardly fill up the buffers.
On the other hand, it could make the connection more resilient.

Having several threads for (e.g. one for read and one for write) would
resolve "deadlock out of buffers got full" issue, so it is good no matter
if we add "ping" there.

Vladimir

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message jingzhi.zhang@outlook.com 2016-06-07 13:05:21 Re: PrepareStatement.execute() blocked because of long time 'create index' operation, connection leak
Previous Message Vitalii Tymchyshyn 2016-06-07 12:34:33 Re: PrepareStatement.execute() blocked because of long time 'create index' operation, connection leak