You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Knut Anders Hatlen (Updated) (JIRA)" <ji...@apache.org> on 2011/12/08 14:56:39 UTC

[jira] [Updated] (DERBY-5517) testReplication_Local_3_p1_StateNegativeTests failed with connection refused

     [ https://issues.apache.org/jira/browse/DERBY-5517?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Knut Anders Hatlen updated DERBY-5517:
--------------------------------------

    Attachment: d5517-1a.diff

I was wondering if the root cause for these failures could be similar the same problem that caused DERBY-4201, so I tried to run the replication tests with the repro patch attached to that issue. And indeed many of the replication tests failed with connection refused when they ran with the patched code.

So it seems like one possible cause of the problem reported here, is that a server (slave or master) is not fully shut down after ReplicationRun.tearDown() has completed. tearDown() invokes a shutdown command on the slave server and on the master server. However, as seen in DERBY-4201, a server shutdown command returns when the server stops responding, which happens before the server is fully closed down. So if a new network server is started shortly thereafter, it may not be able to start successfully because the port hasn't been released yet. Since the network server doesn't start, clients that try to connect will see "connection refused" errors.

The attached patch attempts to address this issue by letting ReplicationRun.tearDown() wait until all server processes have completed. It does that by keeping a list of java.lang.Thread instances that read the output from the server processes, and calls join() on all those threads in tearDown(). This way, we won't start the next test case (and the next server) until the servers started by the previous test case have been terminated.

With this patch, the replication test suite ran cleanly, even with the repro patch from DERBY-4201.
                
> testReplication_Local_3_p1_StateNegativeTests failed with connection refused
> ----------------------------------------------------------------------------
>
>                 Key: DERBY-5517
>                 URL: https://issues.apache.org/jira/browse/DERBY-5517
>             Project: Derby
>          Issue Type: Bug
>          Components: Replication, Test
>    Affects Versions: 10.9.0.0
>            Reporter: Knut Anders Hatlen
>         Attachments: d5517-1a.diff
>
>
> http://dbtg.foundry.sun.com/derby/test/Daily/jvm1.6/testing/testlog/sles/1206494-suitesAll_diff.txt
> There was 1 error:
> 1) testReplication_Local_3_p1_StateNegativeTests(org.apache.derbyTesting.functionTests.tests.replicationTests.ReplicationRun_Local_3_p1)java.lang.Exception: DRDA_NoIO.S:Could not connect to Derby Network Server on host 127.0.0.1, port 1532: Connection refused
> 	at org.apache.derby.impl.drda.NetworkServerControlImpl.consolePropertyMessageWork(Unknown Source)
> 	at org.apache.derby.impl.drda.NetworkServerControlImpl.consolePropertyMessage(Unknown Source)
> 	at org.apache.derby.impl.drda.NetworkServerControlImpl.setUpSocket(Unknown Source)
> 	at org.apache.derby.impl.drda.NetworkServerControlImpl.ping(Unknown Source)
> 	at org.apache.derby.drda.NetworkServerControl.ping(Unknown Source)
> 	at org.apache.derbyTesting.functionTests.tests.replicationTests.ReplicationRun.ping(ReplicationRun.java:2419)
> 	at org.apache.derbyTesting.functionTests.tests.replicationTests.ReplicationRun.pingServer(ReplicationRun.java:2406)
> 	at org.apache.derbyTesting.functionTests.tests.replicationTests.ReplicationRun.startServer(ReplicationRun.java:2126)
> 	at org.apache.derbyTesting.functionTests.tests.replicationTests.ReplicationRun_Local_3_p1.testReplication_Local_3_p1_StateNegativeTests(ReplicationRun_Local_3_p1.java:90)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:116)
> 	at org.apache.derbyTesting.functionTests.tests.replicationTests.ReplicationRun.runBare(ReplicationRun.java:208)
> 	at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
> 	at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
> 	at junit.extensions.TestSetup.run(TestSetup.java:25)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira