Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Y1ZiH-0005hv-T0 for pgsql-jdbc@arkaria.postgresql.org; Thu, 18 Dec 2014 11:57:50 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Y1ZiG-0000LS-G9 for pgsql-jdbc@arkaria.postgresql.org; Thu, 18 Dec 2014 11:57:48 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Y1ZiE-0000LK-RJ for pgsql-jdbc@postgresql.org; Thu, 18 Dec 2014 11:57:47 +0000 Received: from oms-m02.mx.aol.com ([64.12.231.63]) by makus.postgresql.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1Y1Zi3-0003cS-Te for pgsql-jdbc@postgresql.org; Thu, 18 Dec 2014 11:57:43 +0000 Received: from omr-m08.mx.aol.com (omr-m08.mx.aol.com [64.12.222.129]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by oms-m02.mx.aol.com (AOL Outbound OMS Interface) with ESMTPS id 3608E38001820 for ; Thu, 18 Dec 2014 06:57:01 -0500 (EST) Received: from mtaomg-mab02.mx.aol.com (mtaomg-mab02.mx.aol.com [172.26.249.84]) by omr-m08.mx.aol.com (Outbound Mail Relay) with ESMTP id 2A3127039CDC3; Thu, 18 Dec 2014 06:56:59 -0500 (EST) Received: from core-lpb01d.mail.aol.com (core-lpb01.mail.aol.com [10.76.10.11]) by mtaomg-mab02.mx.aol.com (OMAG/Core Interface) with ESMTP id E5F7D38000082; Thu, 18 Dec 2014 06:56:58 -0500 (EST) To: pg@fastcrypt.com Subject: Re: Infinite waitOnLock X-MB-Message-Source: WebUI Received: from 108.7.154.10 by webmail-vm124.sysops.aol.com (64.12.251.115) with HTTP (WebMailUI); Thu, 18 Dec 2014 06:56:58 -0500 MIME-Version: 1.0 From: rapidtransit440@aol.com X-MB-Message-Type: User Content-Type: multipart/alternative; boundary="--------MB_8D1E8D0DCA5CA02_1320_2636A_webmail-vm124.sysops.aol.com" X-Mailer: AOL Webmail STANDARD Cc: pgsql-jdbc@postgresql.org Message-Id: <8D1E8D0DC762E82-1320-C263@webmail-vm124.sysops.aol.com> X-Originating-IP: [108.7.154.10] Date: Thu, 18 Dec 2014 06:56:58 -0500 x-aol-global-disposition: S X-SPAM-FLAG: YES DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mx.aol.com; s=20140625; t=1418903819; bh=7OROMbUkE2gGNNnsGdfJpMUZ8U5RlKwAXT54DWwNlZw=; h=From:To:Subject:Message-Id:Date:MIME-Version:Content-Type; b=fZXIdELL6G6BRS5kdr2Pm1+oQ4GHlivM/VhSyGZSnkAbrT3k+gBQ9n4MzY1XYCm/Y 7/9vQzEe75aHQLSv08Hg5O3QprqWi/ko0/zn9xmRFmRjDge4p6mdpJqEG3MAuEp016 2tUe4K8pRiEGK+Kmh+4L/1nRXLvzoqCsBfovPPV4= X-AOL-REROUTE: YES x-aol-sid: 3039ac1af9545492c10a5e04 X-Pg-Spam-Score: 1.3 (+) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-jdbc Precedence: bulk Sender: pgsql-jdbc-owner@postgresql.org This is a multi-part message in MIME format. ----------MB_8D1E8D0DCA5CA02_1320_2636A_webmail-vm124.sysops.aol.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="us-ascii" =0AIf=20I=20could=20chime=20in=20the=20best=20possible=20solution=20would=20be=20= an=20active=20monitor,=20other=20software=20use=20this=20technique=20I=20believe= =20they=20call=20it=20a=20"heartbeat",=20what=20you=20could=20do=20is=20have=20a= n=20active=20thread=20that=20occasionally=20sends=20a=20packet=20and=20waits=20f= or=20a=20response,=20that=20can=20time=20out,=20there=20may=20be=20some=20corner= =20cases=20where=20this=20could=20lead=20to=20an=20occasional=20false=20positive= ?=0A=0A=0A=0AI=20think=20some=20frameworks=20may=20use=20this=20but=20I=20know=20= this=20is=20what=20is=20used=20in=20id=20source=20engines,=20(I=20guess=20playin= g=20games=20do=20come=20in=20handy),=20a=20quick=20Google=20search=20come=20here= 's=20a=20link=20of=20a=20report:=0A=0AServer=20Discovery=20for=20Quake=20III=20A= rena,=20Wolfenstein=20Enemy=20Territory=20and=20Quake=204=0AG.=20Armitage=0ACent= re=20for=20Advanced=20Internet=20Architectures,=20Technical=20Report=20070730A=0A= =0Ahttp://caia.swin.edu.au/reports/070730A/CAIA-TR-070730A.pdf=0A=0A=0A-----Orig= inal=20Message-----=0A=0A=0ASo=20looking=20at=20the=20code,=20it=20is=20in=20an=20= endless=20loop,=20the=20only=20way=20out=20is=20either=20get=20the=20lock=20or=20= get=20interrupted.=20I=20does=20not=20look=20like=20the=20latter=20occurs=20whic= h=20is=20a=20problem=20with=20akka.=0A=0A=0AWhen=20it=20shuts=20down=20it=20shou= ld=20interrupt=20all=20threads=0A=0A=0A=0A=0A=0A=0A=0ADave=20Cramer=0A=0Adave.cr= amer(at)credativ(dot)ca=0Ahttp://www.credativ.ca=0A=0A=0A=0AOn=2010=20December=20= 2014=20at=2009:09,=20Leonard=20Meyer=20=20wrote:=0A=0AActual= ly=20I=20already=20tried=20forking=20and=20putting=20a=20one=20minute=20timeout=20= in=20the=20wait.=20But=20absolutely=20nothing=20changed.=20But=20maybe=20I=20for= got=20something=20I=20don't=20know=20how=20all=20this=20works.=0A=0A=0A=0A=0A201= 4-12-10=2014:28=20GMT+01:00=20Dave=20Cramer=20:=0A=0ASo=20I'm=20= curious=20why=20doesn't=20your=20app=20send=20a=20SIGTERM=20which=20would=20inte= rrupt=20the=20threads.=0AOther=20than=20that=20I=20can=20think=20of=20two=20stra= tegies=0A=0A=0A1)=20make=20isValid=20smarter=0A2)=20put=20a=20timeout=20in=20the= =20wait,=20but=20of=20course=20we=20don't=20know=20how=20long=20to=20wait?=20How= ever=20I=20am=20thinking=20that=20very=20large=20copies=20can't=20be=20that=20co= mmon.=0A=0A=0A=0ADave=20Cramer=0A=0Adave.cramer(at)credativ(dot)ca=0Ahttp://www.= credativ.ca=0A=0A=0A=0A=0AOn=2010=20December=202014=20at=2008:21,=20Leonard=20Me= yer=20=20wrote:=0A=0ASame=20behavior=20with=20jar=20from=20m= aster.=20All=20threads=20are=20logging=20"org.postgresql.util.PSQLException:=20D= atabase=20connection=20failed=20when=20canceling=20copy=20operation"=20and=20go=20= into=20waiting=20state.=0A=0A=0A=0A2014-12-10=2012:34=20GMT+01:00=20Dave=20Crame= r=20:=0A=0ASo=20sure=20enough=20we=20do=20not=20timeout.=20The= =20question=20is=20how=20long=20to=20wait.=20I=20haven't=20looked=20at=20this=20= in=20detail,=20but=20copy=20could=20take=20a=20very=20long=20time=20depending=20= on=20what=20people=20are=20copying=20in/out=0A=0A=0ABefore=20we=20go=20chasing=20= this=20can=20you=20build=20a=20driver=20from=20master=20and=20try=20it?=20=0A=0A= =0A=0ADave=20Cramer=0A=0Adave.cramer(at)credativ(dot)ca=0Ahttp://www.credativ.ca= =0A=0A=0A=0A=0AOn=2010=20December=202014=20at=2003:47,=20Leonard=20Meyer=20=20wrote:=0A=0AHi,=0A=0A=0AI=20was=20advised=20to=20come=20here=20= for=20this=20instead=20of=20the=20pgsql-bugs=20ML.=20As=20I=20already=20explaine= d=20it,=20I'll=20just=20copy=20paste=20the=20problem=20:=0A=0A=0A=0AWe're=20doin= g=20an=20ETL=20Akka=20application=20using=20PostgreSQL=209.3.5=20using=20driver=20= 9.3-1102-jdbc41.=20We're=20currently=20testing=20our=20application=20resilience=20= by=20shutting=20down=20the=20database=20in=20the=20middle=20of=20our=20processin= g.=20Basically=20we=20have=208=20threads=20working=20and=20when=20shutting=20dow= n,=20some=20threads=20just=20get=20stuck=20forever=20waiting=20on=20a=20lock.=0A= We=20think=20it's=20coming=20from=20a=20bug=20inside=20the=20driver=20because=20= we=20would=20expect=20the=20lock=20acquisition=20to=20timeout=20at=20some=20poin= t.=20Here's=20the=20stacktrace=20of=20a=20frozen=20thread=20:=0A=0A=0A=0A"xxxxxx= -akka.actor.pinned-dispatcher-26"=20prio=3D10=20tid=3D0x00007f3a1c007800=20nid=3D= 0x3125=20in=20Object.wait()=20[0x00007f3acaae8000]=0A=20=20=20java.lang.Thread.S= tate:=20WAITING=20(on=20object=20monitor)=0A=09at=20java.lang.Object.wait(Native= =20Method)=0A=09-=20waiting=20on=20<0x0000000744a14aa0>=20(a=20org.postgresql.co= re.v3.QueryExecutorImpl)=0A=09at=20java.lang.Object.wait(Object.java:503)=0A=09a= t=20org.postgresql.core.v3.QueryExecutorImpl.waitOnLock(QueryExecutorImpl.java:9= 1)=0A=09at=20org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.= java:228)=0A=09-=20locked=20<0x0000000744a14aa0>=20(a=20org.postgresql.core.v3.Q= ueryExecutorImpl)=0A=09at=20org.postgresql.jdbc2.AbstractJdbc2Statement.execute(= AbstractJdbc2Statement.java:561)=0A=09at=20org.postgresql.jdbc2.AbstractJdbc2Sta= tement.executeWithFlags(AbstractJdbc2Statement.java:405)=0A=09at=20org.postgresq= l.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:285)=0A=09= at=20org.postgresql.jdbc4.AbstractJdbc4Connection.isValid(AbstractJdbc4Connectio= n.java:130)=0A=09at=20org.postgresql.jdbc4.Jdbc4Connection.isValid(Jdbc4Connecti= on.java:21)=0A=09at=20com.zaxxer.hikari.proxy.ConnectionProxy.isValid(Connection= Proxy.java:357)=0A=09at=20xx.xxxx.actors.flux.mclu.McluProcessor$$anonfun$receiv= e$1.applyOrElse(McluProcessor.scala:65)=0A=09at=20akka.actor.Actor$class.aroundR= eceive(Actor.scala:465)=0A=09at=20xx.xxxx.actors.flux.mclu.McluProcessor.aroundR= eceive(McluProcessor.scala:30)=0A=09at=20akka.actor.ActorCell.receiveMessage(Act= orCell.scala:516)=0A=09at=20akka.actor.ActorCell.invoke(ActorCell.scala:487)=0A=09= at=20akka.dispatch.Mailbox.processMailbox(Mailbox.scala:254)=0A=09at=20akka.disp= atch.Mailbox.run(Mailbox.scala:221)=0A=09at=20java.util.concurrent.ThreadPoolExe= cutor.runWorker(ThreadPoolExecutor.java:1145)=0A=09at=20java.util.concurrent.Thr= eadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)=0A=09at=20java.lang.Thre= ad.run(Thread.java:744)=0A=20=20=20Locked=20ownable=20synchronizers:=0A=09-=20<0= x000000074482e6d0>=20(a=20java.util.concurrent.ThreadPoolExecutor$Worker)=0A=0A=0A= =20We've=20first=20dropped=20by=20the=20Akka=20group,=20thinking=20it=20was=20a=20= problem=20with=20our=20code,=20but=20nothing=20came=20up.=20HikariCP's=20main=20= developper=20showed=20up=20with=20an=20explanation=20though=20:=0A=0A=0AIt=20app= ears=20that=20you=20are=20using=20the=20PostgreSQL=20CopyManager,=20correct?=20=20= Looking=20at=20QueryExecutorImpl=20it=20appears=20that=20rollback()=20is=20tryin= g=20to=20obtain=20a=20lock=20that=20was=20not=20released=20by=20the=20CopyManage= r.=20=20I=20recommend=20using=20the=20CopyManager.copyIn()=20method=20that=20ret= urns=20a=20CopyIn=20object,=20rather=20than=20using=20the=20convenience=20method= =20that=20takes=20a=20reader.=20=20Use=20the=20writeToCopy()=20to=20pump=20the=20= data=20in,=20and=20be=20sure=20to=20catch=20SQLException.=20=20If=20you=20get=20= an=20SQLException,=20call=20cancelCopy()=20and=20retry=20or=20whatever=20your=20= recovery=20scenario=20is,=20otherwise=20call=20endCopy().=20=20I=20would=20have=20= expected=20PostgreSQL=20to=20handle=20the=20severing=20of=20a=20Connection=20in=20= the=20middle=20of=20a=20bulk=20copy=20better,=20but=20that=20is=20probably=20a=20= question=20for=20the=20PostgreSQL=20group.=0A=0A=0ATried=20it,=20no=20luck.=20He= re=20the=20link=20for=20reference=20:=20https://groups.google.com/forum/#!topic/= akka-user/Ehzioy3jVoU=0A=0A=0A=20Here's=20what=20we=20can=20show=20you=20of=20ou= r=20(scala)=20code=20:=0A=20=0A=20val=20cpManager=20=3D=20connection.unwrap(clas= sOf[PGConnection]).getCopyAPI=0A=20=20=20=20val=20stringBytes:=20Array[Byte]=20=3D= =20batchStrings.map(_.toByte).toArray=0A=20=20=20=20val=20copy=20=3D=20cpManager= .copyIn(s"COPY=20temp=20FROM=20STDIN=20WITH=20CSV")=0A=20=20=20=20try=20{=0A=20=20= =20=20=20=20copy.writeToCopy(stringBytes,=200,=20stringBytes.size)=0A=20=20=20=20= =20=20copy.endCopy()=0A=20=20=20=20}=20finally=20{=0A=20=20=20=20=20=20if=20(cop= y.isActive)=20{=0A=20=20=20=20=20=20=20=20copy.cancelCopy()=0A=20=20=20=20=20=20= }=0A=20=20=20=20}=0A=0A=0A=20Connection=20used=20is=20closed=20further=20down=20= in=20a=20finally=20block.=0A=0A=0AWe're=20rather=20sure=20the=20lock=20is=20comi= ng=20from=20here=20since=20we=20have=20another=20exactly=20similar=20processing=20= but=20with=20regular=20inserts=20instead=20of=20this,=20and=20no=20issues=20so=20= far.=20Thanks=20for=20any=20help.=0A=0A=0A=0A=0A=0A=0A=0A=0A=0A=0A=0A=0A=0A=0A=0A= =0A=0A=0A=0A=0A=0A ----------MB_8D1E8D0DCA5CA02_1320_2636A_webmail-vm124.sysops.aol.com Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset="us-ascii" =0A=0A=0AIf= =20I=20could=20chime=20in=20the=20best=20possible=20solution=20would=20be=20an=20= active=20monitor,=20other=20software=20use=20this=20technique=20I=20believe=20th= ey=20call=20it=20a=20"heartbeat",=20what=20you=20could=20do=20is=20have=20an=20a= ctive=20thread=20that=20occasionally=20sends=20a=20packet=20and=20waits=20for=20= a=20response,=20that=20can=20time=20out,=20there=20may=20be=20some=20corner=20ca= ses=20where=20this=20could=20lead=20to=20an=20occasional=20false=20positive?=0A=0A<= font=20color=3D"black"=20face=3D"arial">=0A<= br>=0A=0A=0AI=20think=20some=20framewo= rks=20may=20use=20this=20but=20I=20know=20this=20is=20what=20is=20used=20in=20id= =20source=20engines,=20(I=20guess=20playing=20games=20do=20come=20in=20handy),=20= a=20quick=20Google=20search=20come=20here's=20a=20link=20of=20a=20report:=0A= =0A=0ASe= rver=20Discovery=20for=20Quake=20III=20Arena,=20Wolfenstein Enemy=20Territory=20and=20Quake=204=0A=0AG.=20Armitage=0A=0ACentre=20for=20Advanced=20Internet=20Architectures,=20Technical=20Repo= rt=20070730A=0A=0A=0Ahttp://caia= .swin.edu.au/reports/070730A/CAIA-TR-070730A.pdf
=0A=0A
=0A=0A=0A=0A-----Original=20Message-----
=0A=0A
=0A=0A=0A=0A=0A=0A=0A=0A=0A=0AS= o=20looking=20at=20the=20code,=20it=20is=20in=20an=20endless=20loop,=20the=20onl= y=20way=20out=20is=20either=20get=20the=20lock=20or=20get=20interrupted.=20I=20d= oes=20not=20look=20like=20the=20latter=20occurs=20which=20is=20a=20problem=20wit= h=20akka.=0A=0A

=0A=0A
=0A=0A=0A=0A
When=20it=20shuts=20down=20= it=20should=20interrupt=20all=20threads
=0A=0A=0A=0A

=0A=0A
=0A= =0A=0A=0A

=0A=0A
=0A=0A=0A=0A=0A=0A=0A=0A
=0A=0ADave=20= Cramer
=0A=0A
=0A=0Adave.cramer(at)credativ(dot)ca
=0A=0Ahttp://www.credativ.ca
=0A=0A<= /div>=0A=0A
=0A=0A=0A
=0A=0A=0A=0AOn=2010=20= December=202014=20at=2009:09,=20Leonard=20Meyer=20<lmeyer@excilys.com>=20wrote:
= =0A=0A=0A=0A= Actually=20I=20= already=20tried=20forking=20and=20putting=20a=20one=20minute=20timeout=20in=20th= e=20wait.=20But=20absolutely=20nothing=20changed.=20But=20maybe=20I=20forgot=20s= omething=20I=20don't=20know=20how=20all=20this=20works.
=0A=0A=0A= =0A=0A=0A=0A=0A=0A=0A
=0A=0A=0A=0A2014-12-10=201= 4:28=20GMT+01:00=20Dave=20Cramer=20<pg@fastcrypt.com>:
=0A=0A=0A=0ASo=20I'm=20curious=20why=20doesn't=20= your=20app=20send=20a=20SIGTERM=20which=20would=20interrupt=20the=20threads.=0A=0A=
Other=20than=20that=20I=20can=20think=20of=20two=20strategies
=0A=0A=0A= =0A

=0A=0A
=0A=0A=0A=0A
1)=20make=20isValid=20smarter
=0A=0A= =0A=0A
2)=20put=20a=20timeout=20in=20the=20wait,=20but=20of=20course=20we=20= don't=20know=20how=20long=20to=20wait?=20However=20I=20am=20thinking=20that=20ve= ry=20large=20copies=20can't=20be=20that=20common.
=0A=0A=0A=0A=0A=0A<= div=20class=3D"gmail_extra">=0A=0A
=0A=0A
Dave= =20Cramer
=0A=0A
=0A=0Adave.cramer(at)credativ(dot)ca
=0A=0Ahttp://www.credativ.ca
=0A=0A=
=0A=0A
=0A=0A=0A
=0A=0A
=0A=0A
=0A=0A
=0A=0AOn=2010=20December=202014=20at=2008:21,=20Leonard=20Meyer=20= <lmeyer@excilys.c= om>=20wrote:
=0A=0A=0A=0A= Same=20behavior=20with=20jar=20from=20master.=20All=20threads= =20are=20logging=20"org.postgresql.util.PSQLException:=20Database=20connection=20= failed=20when=20canceling=20copy=20operation"=20and=20go=20into=20waiting=20stat= e.
=0A=0A=0A=0A
=0A=0A
=0A=0A
=0A=0A= =0A=0A2014-12-10=2012:34=20GMT+01:00=20Dave=20Crame= r=20<pg@fastcrypt.c= om>:
=0A=0A=0A=0ASo=20sure=20enough=20we=20do=20not=20timeout.=20The=20question=20is=20= how=20long=20to=20wait.=20I=20haven't=20looked=20at=20this=20in=20detail,=20but=20= copy=20could=20take=20a=20very=20long=20time=20depending=20on=20what=20people=20= are=20copying=20in/out=0A=0A

=0A=0A
=0A=0A=0A=0A
Before=20we=20= go=20chasing=20this=20can=20you=20build=20a=20driver=20from=20master=20and=20try= =20it? 
=0A=0A
=0A=0A=0A=0A=0A=0A
=0A=0A
Dave=20Cramer
=0A=0A
=0A=0Adave.cramer(at= )credativ(dot)ca
=0A=0Ahttp://www.credativ.ca
=0A=0A
=0A=0A
=0A=0A=0A=0A
=0A=0A=
=0A
=0A=0A=0A=0AOn=2010=20December=202014=20= at=2003:47,=20Leonard=20Meyer=20<lmeyer@excilys.com>=20wrote:
=0A=0A=0A=0AHi,=0A=0A

=0A=0A
=0A= =0A=0A=0A
I=20was=20advised=20to=20come=20here=20for=20this=20instead=20of=20= the=20pgsql-bugs=20ML.=20As=20I=20already=20explained=20it,=20I'll=20just=20copy= =20paste=20the=20problem=20:
=0A=0A=0A=0A

=0A=0A
=0A=0A=0A=0A<= div>=0A=0AWe're=20doing=20an=20ETL= =20Akka=20application=20using=20PostgreSQL=209.3.5=20using=20driver 9.3-110= 2-jdbc41.=20We're=20currently=20testing=20our=20application=20resilience=20by=20= shutting=20down=20the=20database=20in=20the=20middle=20of=20our=20processing.=20= Basically=20we=20have=208=20threads=20working=20and=20when=20shutting=20down,=20= some=20threads=20just=20get=20stuck=20forever=20waiting=20on=20a=20lock.
=0A= =0A=0A=0AWe=20think=20it's=20comin= g=20from=20a=20bug=20inside=20the=20driver=20because=20we=20would=20expect=20the= =20lock=20acquisition=20to=20timeout=20at=20some=20point.=20Here's=20the=20stack= trace=20of=20a=20frozen=20thread=20:
=0A=0A
=0A=0A=0A=0A
=0A=0A
=0A=0A"xxxxxx-akka.actor.pinned-dispatcher-26"=20prio=3D10=20tid=3D0x00007f= 3a1c007800=20nid=3D0x3125=20in=20Object.wait()=20[0x00007f3acaae8000]
=0A=0A<= /span> =20 java.lang.Th= read.State:=20WAITING=20(on=20object=20monitor)
=0A=0A=09at=20java.lang.Object.wait(Native=20Method)
=0A=0A= =09-=20waiting=20on=20<0x000= 0000744a14aa0>=20(a=20org.postgresql.core.v3.QueryExecutorImpl)
=0A=0A=09at=20java.lang.Object.wait(Object.java:503)
=0A=0A=09at=20org.postgresql.core.v3.QueryExecutorImpl.waitOnLock(QueryExecutorImpl.java:91)
=0A=0A=09at=20org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:228)
=0A=0A= =09-=20locked=20<0x0000000744a14aa0= >=20(a=20org.postgresql.core.v3.QueryExecutorImpl)
=0A=0A=09at=20org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc= 2Statement.java:561)
=0A= =0A=09= at=20org.postgresql.jdbc2.= AbstractJdbc2Statement.
executeWithFlags(AbstractJdbc2Statement.java:405)
=0A=0A=09at=20org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:285)
=0A=0A=09at=20org.postgresql.jdbc4.AbstractJdbc4Connection.i= sValid(AbstractJdbc4Connec= tion.java:130)
=0A=0A=09
at=20org.postgresql.jdbc4.Jdbc4Connection.isValid(
Jdbc4Connection.java:21)
=0A=0A= =09at=20com.zaxxer.hikari.proxy= .ConnectionProxy.isValid(<= /span>ConnectionProxy.java:357)=0A=0A=09at=20xx.xxxx.actors.= flux.mclu.McluProcessor$$a= nonfun$receive$1.applyOrEl= se(McluProcessor.scala:65)=
=0A=0A=09at=20akka.actor.Ac= tor$class.aroundReceive(Ac= tor.scala:465)
=0A=0A=09at&n= bsp;xx.xxxx.actors.flux.mclu.McluProcessor.aroundReceive(McluProcessor.scala:30)
=0A=0A=09at=20akka.actor.ActorCell.receiveMessage(ActorCell.scala:516)
=0A=0A=09at=20akka.actor.ActorCell.invoke(ActorCell.scala:487)
=0A=0A=09at=20akka.dispatch.Mailbox.processMailbox(Mailbox.scala:254)
=0A=0A=09= at=20akka.dispatch.Mailbox.run(Mailbox.scala:221)
=0A=0A=09at=20java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
=0A=0A=09at=20java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
=0A=0A=09at=20java.lang.Thread.run(Thread.java:744)
=0A=0A =20 Locked=20ownable=20synchronizers:<= br>=0A=0A=09-=20<0x000000074= 482e6d0>=20(a=20java.util.concurrent.ThreadPoolExecutor$Worker)=0A=0A

=0A=0A=
=0A=0A=0A=0A
 We'v= e=20first=20dropped=20by=20the=20Akka=20group,=20thinking=20it=20was=20a=20probl= em=20with=20our=20code,=20but=20nothing=20came=20up.=20HikariCP's=20main=20devel= opper=20showed=20up=20with=20an=20explanation=20though=20:
=0A=0A=0A= =0A

=0A=0A
=0A= =0AIt=20appears=20that=20you=20are=20using=20the=20Postgr= eSQL=20CopyManager,=20correct? =20Looking=20at QueryExecutorImpl it=20appe= ars=20that=20rollback()=20is=20trying=20to=20obtain=20a=20lock=20that=20was=20no= t=20released=20by=20the=20CopyManager. =20I=20recommend=20using=20the=20Cop= yManager.copyIn()=20method=20that=20returns=20a CopyIn obje= ct,=20rather=20than=20using=20the=20convenience=20method=20that=20takes=20a=20re= ader. =20Use=20the writeToCopy() to=20pump=20the=20data= =20in,=20and=20be=20sure=20to=20catch=20SQLException. =20If=20you=20get=20a= n=20SQLException,=20call cancelCopy()=20and=20retry=20or=20whatever= =20your=20recovery=20scenario=20is,=20otherwise=20call endCopy().&n= bsp;=20I=20would=20have=20expected=20PostgreSQL=20to=20handle=20the=20severing=20= of=20a=20Connection=20in=20the=20middle=20of=20a=20bulk=20copy=20better,=20but=20= that=20is=20probably=20a=20question=20for=20the=20PostgreSQL=20group.=0A=0A

=0A=0A
=0A=0A=0A=0ATried=20it,=20no=20luck.=20Here=20the=20link=20for=20reference=20:=  https://groups.google.com/forum/#!topic/akka-user/Ehzioy3j= VoU=0A=0A=0A=0A
=0A=0A= =0A=0A=0A=0A Here's=20w= hat=20we=20can=20show=20you=20of=20our=20(scala)=20code=20:=0A=0A=0A=0A =0A=0A val=20cpManager=20=3D=20connection.unwrap(classOf[PGConnection]).getCopyAPI
=0A=0A =20 =20val=20stringBytes:=20= Array[Byte]=20=3D=20batchStrings.map(_.toByte).toArray
=0A=0A =20 =20val=20copy=20=3D=20cpManager.copyIn(s"COPY=20temp=20= FROM=20STDIN=20WITH=20CSV")
=0A=0A =20 =20try=20{
=0A=0A =20 =20 =20copy.writeToCopy(stringBytes,=200= ,=20stringBytes.size)
=0A=0A =20 =20 =20copy.endCopy()
=0A=0A =20 =20}=20finally=20{
=0A=0A=  =20 =20 =20if=20(= copy.isActive)=20{
=0A=0A =20 =20 =20 =20copy.cancelCopy()
=0A=0A =20 =20 =20}
=0A=0A =20 =20}
=0A=0A

=0A=0A
=0A=0A=0A=0A
 Connection=20used=20is=20closed=20further=20down=20in= =20a=20finally=20block.
=0A=0A=0A=0A
=0A=0A=0A=0A=0A=0AWe're=20rather=20sure=20the=20lock=20is=20coming=20from=20here=20since=20= we=20have=20another=20exactly=20similar=20processing=20but=20with=20regular=20in= serts=20instead=20of=20this,=20and=20no=20issues=20so=20far.=20Thanks=20for=20an= y=20help.=0A=0A=0A=0A=0A=0A=0A
=0A=0A=0A= =0A=0A=0A=0A=0A=0A=0A=0A
=0A=0A=0A=0A=0A= =0A=0A=0A=0A=0A=0A
=0A=0A=0A=0A=0A= =0A=0A=0A=0A=0A=0A
=0A=0A=0A=0A=0A=0A=0A= =0A=0A=0A=0A
=0A=0A=0A=0A=0A=0A=0A=0A=0A= =0A=0A=0A=0A=0A=0A=0A=0A=0A=0A=0A ----------MB_8D1E8D0DCA5CA02_1320_2636A_webmail-vm124.sysops.aol.com--