ClientRead on ROLLABACK - Mailing list pgsql-hackers

From Simone Giusso
Subject ClientRead on ROLLABACK
Date
Msg-id CAH0h0tKwkM6TA5F1scT=_dTW=-1YO5k3_+WL+5+ouwrR0aY8hw@mail.gmail.com
Whole thread Raw
Responses Re: ClientRead on ROLLABACK
List pgsql-hackers
I have a question regarding postgresql waiting for the client. I queried the pg_stat_activity because I noticed a connection that had not been released for days!!! I saw that the wait_event was ClientRead and the query was ROLLBACK. What the server is waiting for from the client? It is a simple ROLLBACK. I'd expect postgresql to abort the transaction, that's it!
This was the client thread stack trace:

at sun.nio.ch.Net.poll(Native Method)
at sun.nio.ch.NioSocketImpl.park()
at sun.nio.ch.NioSocketImpl.park()
at sun.nio.ch.NioSocketImpl.implRead()
at sun.nio.ch.NioSocketImpl.read()
at sun.nio.ch.NioSocketImpl$1.read()
at java.net.Socket$SocketInputStream.read()
at sun.security.ssl.SSLSocketInputRecord.read()
at sun.security.ssl.SSLSocketInputRecord.readFully()
at sun.security.ssl.SSLSocketInputRecord.decodeInputRecord()
at sun.security.ssl.SSLSocketInputRecord.decode()
at sun.security.ssl.SSLTransport.decode()
at sun.security.ssl.SSLSocketImpl.decode()
at sun.security.ssl.SSLSocketImpl.readApplicationRecord()
at sun.security.ssl.SSLSocketImpl$AppInputStream.read()
at org.postgresql.core.VisibleBufferedInputStream.readMore(VisibleBufferedInputStream.java:161)
at org.postgresql.core.VisibleBufferedInputStream.ensureBytes(VisibleBufferedInputStream.java:128)
at org.postgresql.core.VisibleBufferedInputStream.ensureBytes(VisibleBufferedInputStream.java:113)
at org.postgresql.core.VisibleBufferedInputStream.read(VisibleBufferedInputStream.java:73)
at org.postgresql.core.PGStream.receiveChar(PGStream.java:453)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2120)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:356)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:316)
at org.postgresql.jdbc.PgConnection.executeTransactionCommand(PgConnection.java:879)
at org.postgresql.jdbc.PgConnection.rollback(PgConnection.java:922)
at com.zaxxer.hikari.pool.ProxyConnection.rollback(ProxyConnection.java:396)
at com.zaxxer.hikari.pool.HikariProxyConnection.rollback(HikariProxyConnection.java)
at org.hibernate.resource.jdbc.internal.AbstractLogicalConnectionImplementor.rollback(AbstractLogicalConnectionImplementor.java:121)
at org.hibernate.resource.transaction.backend.jdbc.internal.JdbcResourceLocalTransactionCoordinatorImpl$TransactionDriverControlImpl.rollback(JdbcResourceLocalTransactionCoordinatorImpl.java:304)
at org.hibernate.engine.transaction.internal.TransactionImpl.rollback(TransactionImpl.java:142)
at org.springframework.orm.jpa.JpaTransactionManager.doRollback(JpaTransactionManager.java:589)
...

So I ended up in a situation where both client and server were reading from the socket :(. I'm not sure why. Something went wrong between client and server, network problems? The connection was held for 5 days until it was manually terminated. But why the server was waiting in the first place?

--
Simone Giusso

pgsql-hackers by date:

Previous
From: ikedarintarof
Date:
Subject: Re: doc: modify the comment in function libpqrcv_check_conninfo()
Next
From: Jelte Fennema-Nio
Date:
Subject: Re: libpq: Fix lots of discrepancies in PQtrace