| CODENOTIFIER | HelpYou are not signed inSign in |
Project: Terracotta
Revision: 9984
Author: etsai
Date: 04 Sep 2008 20:40:04
Changes:reverted 9965 and 9872, they were fix for DEV-1856, see MNK-707
Files:| ... | ...@@ -16,7 +16,6 @@ | |
| 16 | 16 | import com.tc.net.protocol.transport.DefaultConnectionIdFactory; |
| 17 | 17 | import com.tc.net.protocol.transport.NullConnectionPolicy; |
| 18 | 18 | import com.tc.object.session.NullSessionManager; |
| 19 | import com.tc.util.concurrent.ThreadUtil; | |
| 20 | 19 | |
| 21 | 20 | import java.util.HashSet; |
| 22 | 21 | import java.util.Set; |
| ... | ...@@ -119,24 +118,13 @@ | |
| 119 | 118 | |
| 120 | 119 | ClientMessageChannel channel; |
| 121 | 120 | channel = clientComms |
| 122 | .createClientChannel( | |
| 123 | sessionManager, | |
| 124 | 0, | |
| 125 | TCSocketAddress.LOOPBACK_IP, | |
| 126 | lsnr.getBindPort(), | |
| 127 | 3000, | |
| 128 | new ConnectionAddressProvider( | |
| 129 | new ConnectionInfo[] { new ConnectionInfo( | |
| 130 | "localhost", | |
| 131 | lsnr | |
| 132 | .getBindPort()) })); | |
| 121 | .createClientChannel(sessionManager, 0, TCSocketAddress.LOOPBACK_IP, lsnr.getBindPort(), 3000, | |
| 122 | new ConnectionAddressProvider(new ConnectionInfo[] { new ConnectionInfo("localhost", lsnr | |
| 123 | .getBindPort()) })); | |
| 133 | 124 | channel.open(); |
| 134 | 125 | assertTrue(channel.isConnected()); |
| 135 | 126 | |
| 136 | while (!channelManager.getChannels()[0].isConnected()) { | |
| 137 | System.out.println("waiting for server to send final Tx ACK for client connection"); | |
| 138 | ThreadUtil.reallySleep(1000); | |
| 139 | } | |
| 127 | assertEquals(1, channelManager.getChannels().length); | |
| 140 | 128 | clientComms.getConnectionManager().closeAllConnections(5000); |
| 141 | 129 | assertFalse(channel.isConnected()); |
| 142 | 130 | |
| ... | ...@@ -199,8 +187,8 @@ | |
| 199 | 187 | } |
| 200 | 188 | |
| 201 | 189 | public short getStackLayerFlag() { |
| 202 | // its a test | |
| 203 | // do nothing | |
| 190 | //its a test | |
| 191 | //do nothing | |
| 204 | 192 | throw new ImplementMe(); |
| 205 | 193 | } |
| 206 | 194 |
| ... | ...@@ -58,7 +58,7 @@ | |
| 58 | 58 | |
| 59 | 59 | private void verifyAndHandleAck(WireProtocolMessage message) { |
| 60 | 60 | if (!verifyAck(message)) { |
| 61 | handleHandshakeError(new TransportHandshakeErrorContext("Expected an ACK message but received: " + message, | |
| 61 | handleHandshakeError(new TransportHandshakeErrorContext("Expected an ACK message but received: " + message, | |
| 62 | 62 | TransportHandshakeError.ERROR_HANDSHAKE)); |
| 63 | 63 | } else { |
| 64 | 64 | handleAck((TransportHandshakeMessage) message); |
| ... | ...@@ -88,16 +88,4 @@ | |
| 88 | 88 | |
| 89 | 89 | } |
| 90 | 90 | |
| 91 | public void closeEvent(TCConnectionEvent event) { | |
| 92 | synchronized (status) { | |
| 93 | if (status.isEstablished()) { | |
| 94 | status.reset(); | |
| 95 | super.closeEvent(event); | |
| 96 | } else { | |
| 97 | // DEV-1856 : Don't bother for connections which actually didn't make up to Transport Establishment. | |
| 98 | logger.warn("Connection : " + event.getSource() + ", which was not Transport Established, got closed"); | |
| 99 | } | |
| 100 | } | |
| 101 | } | |
| 102 | ||
| 103 | 91 | } |
| 104 | 92 | \ No newline at end of file |
| ... | ...@@ -68,8 +68,7 @@ | |
| 68 | 68 | connManager = new MockConnectionManager(); |
| 69 | 69 | connManager.setConnection(clientConnection); |
| 70 | 70 | commsManager = new CommunicationsManagerImpl(new NullMessageMonitor(), new PlainNetworkStackHarnessFactory(), |
| 71 | connManager, new NullConnectionPolicy(), 0, | |
| 72 | new DisabledHealthCheckerConfigImpl()); | |
| 71 | connManager, new NullConnectionPolicy(), 0, new DisabledHealthCheckerConfigImpl()); | |
| 73 | 72 | lsnr = commsManager.createListener(new NullSessionManager(), new TCSocketAddress(0), true, |
| 74 | 73 | new DefaultConnectionIdFactory()); |
| 75 | 74 | lsnr.start(Collections.EMPTY_SET); |
| ... | ...@@ -167,8 +166,6 @@ | |
| 167 | 166 | |
| 168 | 167 | TCConnectionEvent event = new TCConnectionEvent(serverConnection); |
| 169 | 168 | |
| 170 | // if the Transport is not ESTABLISHED, closeEvents cannot climb the stack : DEV-1856 | |
| 171 | serverTransport.status.established(); | |
| 172 | 169 | serverTransport.closeEvent(event); |
| 173 | 170 | assertTrue(serverEventMonitor.waitForDisconnect(1000)); |
| 174 | 171 | assertTrue(extraMonitor.waitForDisconnect(1000)); |
| ... | ...@@ -240,8 +237,7 @@ | |
| 240 | 237 | |
| 241 | 238 | this.clientTransport = new ClientMessageTransport(cce, createHandshakeErrorHandler(), |
| 242 | 239 | this.transportHandshakeMessageFactory, |
| 243 | new WireProtocolAdaptorFactoryImpl(), | |
| 244 | TransportHandshakeMessage.NO_CALLBACK_PORT); | |
| 240 | new WireProtocolAdaptorFactoryImpl(), TransportHandshakeMessage.NO_CALLBACK_PORT); | |
| 245 | 241 | this.clientResponder = new ClientHandshakeMessageResponder(this.clientResponderSentQueue, |
| 246 | 242 | this.clientResponderReceivedQueue, |
| 247 | 243 | this.transportHandshakeMessageFactory, |