BUG #4519: deadlock on commit

From: "Shawn Chasse" <shawnchasse(at)gmail(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #4519: deadlock on commit
Date: 2008-11-10 18:55:17
Message-ID: 200811101855.mAAItH05038977@wwwmaster.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


The following bug has been logged online:

Bug reference: 4519
Logged by: Shawn Chasse
Email address: shawnchasse(at)gmail(dot)com
PostgreSQL version: 8.1.5 & 8.3.3
Operating system: Windows
Description: deadlock on commit
Details:

Hi,
I'm running the a windows server machine running postgres 8.3.3,
postgresql-jdbc driver 8.3 build 603 jdbc4, hibernate 3.2, and java 1.6.

Recently I have run into a problem where a commit call in my java code will
propogate down to the driver and eventually deadlock waiting for a response.
The specific call stack is as follows:

"Analyzer" daemon prio=6 tid=0x67de4400 nid=0x1414 runnable
[0x6890f000..0x6890fc18]
java.lang.Thread.State: RUNNABLE
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:129)
at
org.postgresql.core.VisibleBufferedInputStream.readMore(VisibleBufferedInput
Stream.java:135)
at
org.postgresql.core.VisibleBufferedInputStream.ensureBytes(VisibleBufferedIn
putStream.java:104)
at
org.postgresql.core.VisibleBufferedInputStream.read(VisibleBufferedInputStre
am.java:73)
at org.postgresql.core.PGStream.ReceiveChar(PGStream.java:259)
at
org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.ja
va:1166)
at
org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:351)

- locked <0x0a1db010> (a
org.postgresql.core.v3.QueryExecutorImpl)
at
org.postgresql.jdbc2.AbstractJdbc2Statement.executeBatch(AbstractJdbc2Statem
ent.java:2674)
at
com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeBatch(NewProxyPrep
aredStatement.java:1723)
at
org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:48)
at
org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:246)
at
org.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.java:92)

at
org.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.java:87)

at
org.hibernate.jdbc.AbstractBatcher.prepareBatchStatement(AbstractBatcher.jav
a:222)
at
org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntity
Persister.java:2229)
at
org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntity
Persister.java:2665)
at
org.hibernate.action.EntityInsertAction.execute(EntityInsertAction.java:60)
at
org.hibernate.engine.ActionQueue.execute(ActionQueue.java:279)
at
org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:263)
at
org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:167)
at
org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(Abst
ractFlushingEventListener.java:298)
at
org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventL
istener.java:27)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
at
org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338)
at
org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106)
at
com.exagrid.triage.recv.JarBreaker.processCurrentReportSection(JarBreaker.ja
va:390)
at
com.exagrid.triage.recv.JarBreaker.processReportSegments(JarBreaker.java:353
)
at
com.exagrid.triage.recv.JarBreaker.saveData(JarBreaker.java:79)
at
com.exagrid.triage.recv.ReportAnalyzer.analyzeReport(ReportAnalyzer.java:70)

at
com.exagrid.triage.threads.AnalyzerInstance.processWorkItem(AnalyzerInstance
.java:121)
at
com.exagrid.triage.threads.AnalyzerInstance.run(AnalyzerInstance.java:51)
at java.lang.Thread.run(Thread.java:619)

I am not sure if the problem is specifically related to the driver, or if it
is a postgres problem. I did upgrade from postgres 8.1 to 8.3 and I still
have this problem occurring. One option for me to get around this issue is
to do a vacuum on the database. following the vacuum I do not see this
problem, however it may come back after some time.

I saw this problem start up unexpectedly, it did not occur alongside an
update of my source code so therefore it is hard to attribute it to
something that I may have done. There is a bug that seems to follow the same
path listed in the postgresql mailing lists:

http://archives.postgresql.org/pgsql-hackers/2006-10/msg00289.php

Shawn Chasse

Browse pgsql-bugs by date

  From Date Subject
Next Message Adam Terrey 2008-11-11 03:49:42 BUG #4520: Cases where a forign key constraint is not inforced and when it is incorrectly inforced.
Previous Message Hiroshi Saito 2008-11-10 14:39:32 Re: Bug fix request for 08.03.0400 ( was [BUGS] Behavior change of FK info query)