Thread: I/O Bug
Hi, I've been using Postgres version 8 beta and while everything has been perfect so far, I've noticed that I get a connection reset error when the database is hit pretty hard. For instance, I have several unit tests in Java running DBUnit and it inserts and cleans up the database state after every test case. After many test cases, it eventually makes the database crash. I'm using the latest JDBC 3 driver that comes with the version 8 installer at PGFoundry. Below is a stackstace in Java on what's happening after 220 test cases have run. All other test cases give the same exception as Postgres needs time to load back up again unless I'm only testing under 200 test cases. Have you guys heard of this before from other testers? Is there a fix? Thanks. org.postgresql.util.PSQLException: An I/O error occured while reading from backend - Exception: java.net.SocketException: Connection reset Stack Trace: java.net.SocketException: Connection reset at java.net.SocketInputStream.read(SocketInputStream.java:168) at java.io.BufferedInputStream.fill(BufferedInputStream.java:183) at java.io.BufferedInputStream.read(BufferedInputStream.java:201) at org.postgresql.core.PGStream.ReceiveChar(PGStream.java:166) at org.postgresql.jdbc1.AbstractJdbc1Connection.openConnectionV3(AbstractJdbc1C onnection.java:291) at org.postgresql.jdbc1.AbstractJdbc1Connection.openConnection(AbstractJdbc1Con nection.java:213) at org.postgresql.Driver.connect(Driver.java:139) at java.sql.DriverManager.getConnection(DriverManager.java:512) at java.sql.DriverManager.getConnection(DriverManager.java:171) at com.upfactor.core.test.ResourceTestCaseDetails.getDatabaseConnection(Resourc eTestCaseDetails.java:59) at com.upfactor.core.test.ResourceTestCase.getConnection(ResourceTestCase.java: 62) at org.dbunit.DatabaseTestCase.executeOperation(DatabaseTestCase.java:84) at org.dbunit.DatabaseTestCase.setUp(DatabaseTestCase.java:104) at com.upfactor.rns.service.BusinessServicesTest.setUp(BusinessServicesTest.jav a:36) at junit.framework.TestCase.runBare(TestCase.java:125) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:118) at junit.framework.TestSuite.runTest(TestSuite.java:208) at junit.framework.TestSuite.run(TestSuite.java:203) at junit.framework.TestSuite.runTest(TestSuite.java:208) at junit.framework.TestSuite.run(TestSuite.java:203) at junit.textui.TestRunner.doRun(TestRunner.java:116) at com.intellij.rt.execution.junit2.IdeaJUnitAgent.doRun(IdeaJUnitAgent.java:57 ) at junit.textui.TestRunner.start(TestRunner.java:172) at com.intellij.rt.execution.junit.TextTestRunner2.startRunnerWithArgs(TextTest Runner2.java:23) at com.intellij.rt.execution.junit2.JUnitStarter.prepareStreamsAndStart(JUnitSt arter.java:97) at com.intellij.rt.execution.junit2.JUnitStarter.main(JUnitStarter.java:31) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39 ) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl .java:25) at java.lang.reflect.Method.invoke(Method.java:324) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:78) End of Stack Trace org.postgresql.util.PSQLException: An I/O error occured while reading from backend - Exception: java.net.SocketException: Connection reset Stack Trace: java.net.SocketException: Connection reset at java.net.SocketInputStream.read(SocketInputStream.java:168) at java.io.BufferedInputStream.fill(BufferedInputStream.java:183) at java.io.BufferedInputStream.read(BufferedInputStream.java:201) at org.postgresql.core.PGStream.ReceiveChar(PGStream.java:166) at org.postgresql.jdbc1.AbstractJdbc1Connection.openConnectionV3(AbstractJdbc1C onnection.java:291) at org.postgresql.jdbc1.AbstractJdbc1Connection.openConnection(AbstractJdbc1Con nection.java:213) at org.postgresql.Driver.connect(Driver.java:139) at java.sql.DriverManager.getConnection(DriverManager.java:512) at java.sql.DriverManager.getConnection(DriverManager.java:171) at com.upfactor.core.test.ResourceTestCaseDetails.getDatabaseConnection(Resourc eTestCaseDetails.java:59) at com.upfactor.core.test.ResourceTestCase.getConnection(ResourceTestCase.java: 62) at org.dbunit.DatabaseTestCase.executeOperation(DatabaseTestCase.java:84) at org.dbunit.DatabaseTestCase.setUp(DatabaseTestCase.java:104) at com.upfactor.rns.service.BusinessServicesTest.setUp(BusinessServicesTest.jav a:36) at com.intellij.rt.execution.junit2.IdeaJUnitAgent.doRun(IdeaJUnitAgent.java:57 ) at com.intellij.rt.execution.junit.TextTestRunner2.startRunnerWithArgs(TextTest Runner2.java:23) at com.intellij.rt.execution.junit2.JUnitStarter.prepareStreamsAndStart(JUnitSt arter.java:97) at com.intellij.rt.execution.junit2.JUnitStarter.main(JUnitStarter.java:31) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39 ) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl .java:25) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:78) End of Stack Trace at org.postgresql.core.PGStream.ReceiveChar(PGStream.java:172) at org.postgresql.jdbc1.AbstractJdbc1Connection.openConnectionV3(AbstractJdbc1C onnection.java:291) at org.postgresql.jdbc1.AbstractJdbc1Connection.openConnection(AbstractJdbc1Con nection.java:213) at org.postgresql.Driver.connect(Driver.java:139) at java.sql.DriverManager.getConnection(DriverManager.java:512) at java.sql.DriverManager.getConnection(DriverManager.java:171) at com.upfactor.core.test.ResourceTestCaseDetails.getDatabaseConnection(Resourc eTestCaseDetails.java:59) at com.upfactor.core.test.ResourceTestCase.getConnection(ResourceTestCase.java: 62) at org.dbunit.DatabaseTestCase.executeOperation(DatabaseTestCase.java:84) at org.dbunit.DatabaseTestCase.setUp(DatabaseTestCase.java:104) at com.upfactor.rns.service.BusinessServicesTest.setUp(BusinessServicesTest.jav a:36) at com.intellij.rt.execution.junit2.JUnitStarter.main(JUnitStarter.java:31) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39 ) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl .java:25) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:78)
Ken Egervari wrote: > Hi, > > > > I've been using Postgres version 8 beta and while everything has been > perfect so far, I've noticed that I get a connection reset error when the > database is hit pretty hard. For instance, I have several unit tests in > Java running DBUnit and it inserts and cleans up the database state after > every test case. After many test cases, it eventually makes the database > crash. I'm using the latest JDBC 3 driver that comes with the version 8 > installer at PGFoundry. Below is a stackstace in Java on what's happening > after 220 test cases have run. All other test cases give the same exception > as Postgres needs time to load back up again unless I'm only testing under > 200 test cases. Have you guys heard of this before from other testers? Is > there a fix? Thanks. > > > > org.postgresql.util.PSQLException: An I/O error occured while reading from > backend - Exception: java.net.SocketException: Connection reset Ken, is there anything interesting in the postgresql logs? Oh, and what platform is this on? -- Richard Huxton Archonet Ltd