Message-ID: From: "nicolasbarbier (@nicolasbarbier)" To: "pgjdbc/pgjdbc" Date: Fri, 16 Sep 2016 09:51:38 +0000 Subject: Re: [pgjdbc/pgjdbc] issue #194: PgJDBC can experience client/server deadlocks during batch execution In-Reply-To: References: List-Id: X-GitHub-Author-Login: nicolasbarbier X-GitHub-Comment-Id: 247561787 X-GitHub-Comment-Type: issue_comment X-GitHub-Issue: 194 X-GitHub-Repo: pgjdbc/pgjdbc X-GitHub-Type: comment X-GitHub-Url: https://github.com/pgjdbc/pgjdbc/issues/194#issuecomment-247561787 Content-Type: text/plain; charset=utf-8 Just FYI: We had this problem with Maven artifact org.postgresql:postgresql:9.4.1208.jre6. The stacktrace on the client is: ``` "SqlExecutor-remote" daemon prio=6 tid=0x000000000cbaf000 nid=0x11dc runnable [0x0000000013d0e000] java.lang.Thread.State: RUNNABLE at java.net.SocketOutputStream.socketWrite0(Native Method) at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:113) at java.net.SocketOutputStream.write(SocketOutputStream.java:159) at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82) at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:140) - locked <0x00000000b861f3b8> (a java.io.BufferedOutputStream) at org.postgresql.core.PGStream.flush(PGStream.java:525) at org.postgresql.core.v3.QueryExecutorImpl.sendSync(QueryExecutorImpl.java:1255) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:199) - locked <0x00000000b861f580> (a org.postgresql.core.v3.QueryExecutorImpl) at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:424) at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:161) at org.postgresql.jdbc.PgPreparedStatement.execute(PgPreparedStatement.java:155) ``` The server just shows in pg_stat_activity that it is executing some SQL statement that is part of the batch, with waiting == false. We had it once that that statement was even supposed to return zero rows (because the corresponding table was empty). We only seem to have the problem when the client runs on the same host as the server (connection using TCP from some IP address to the same IP address, not necessarily 127.0.0.1). We only ever had this at our clients that use Windows (but it might also occur on other operating systems). We are trying to find a way to tweak the settings so as to avoid this problem.