This closes #130 fixes

This commit is contained in:
Clebert Suconic 2015-08-14 19:49:10 -04:00
commit 6665e58370
4 changed files with 22 additions and 6 deletions

View File

@ -201,11 +201,12 @@ public class OpenWireConnection implements RemotingConnection, CommandVisitor {
// the connection handles pings, negotiations directly.
// and delegate all other commands to manager.
if (command.getClass() == KeepAliveInfo.class) {
dataReceived = true;
KeepAliveInfo info = (KeepAliveInfo) command;
if (info.isResponseRequired()) {
info.setResponseRequired(false);
protocolManager.sendReply(this, info);
}
info.setResponseRequired(false);
// if we don't respond to KeepAlive commands then the client will think the server is dead and timeout
// for some reason KeepAliveInfo.isResponseRequired() is always false
protocolManager.sendReply(this, info);
}
else if (command.getClass() == WireFormatInfo.class) {
// amq here starts a read/write monitor thread (detect ttl?)

View File

@ -1941,7 +1941,6 @@ public class FailoverTest extends FailoverTestBase {
public void testBackupServerNotRemoved() throws Exception {
// HORNETQ-720 Disabling test for replicating backups.
if (!(backupServer.getServer().getHAPolicy() instanceof SharedStoreSlavePolicy)) {
waitForComponent(backupServer, 1);
return;
}
locator.setFailoverOnInitialConnection(true);

View File

@ -34,7 +34,13 @@ public class ReplicatedLargeMessageWithDelayFailoverTest extends ReplicatedLarge
startBackupServer = false;
super.setUp();
syncDelay = new BackupSyncDelay(backupServer, liveServer);
backupServer.start();
/* Using getName() here is a bit of a hack, but if the backup is started for this test then the test will fail
* intermittently due to an InterruptedException.
*/
if (!getName().equals("testBackupServerNotRemoved")) {
backupServer.start();
}
}
@Override

View File

@ -87,6 +87,16 @@ public class SimpleOpenWireTest extends BasicOpenWireTest {
session.close();
}
@Test
public void testKeepAlive() throws Exception {
connection.start();
Thread.sleep(125000);
connection.createSession(false, 1);
}
@Test
public void testSimpleTopic() throws Exception {
connection.start();