INT-1369 Fix Remaining Timing Hole in TcpNioConnection Where Possibly No Message Assembler Running
This commit is contained in:
@@ -168,6 +168,8 @@ public class TcpNioConnection extends AbstractTcpConnection {
|
||||
if (message != null) {
|
||||
sendToChannel(message);
|
||||
}
|
||||
} else {
|
||||
this.executionControl.decrementAndGet();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
logger.error("Unexpected exception, exiting...", e);
|
||||
|
||||
@@ -40,6 +40,7 @@
|
||||
port="#{server.port}"
|
||||
single-use="true"
|
||||
so-timeout="100000"
|
||||
using-nio="true"
|
||||
input-converter="serializer"
|
||||
output-converter="serializer"
|
||||
interceptor-factory-chain="helloWorldInterceptors"
|
||||
|
||||
@@ -68,12 +68,14 @@ public class InterceptedSharedConnectionTests {
|
||||
fail("Failed to listen");
|
||||
}
|
||||
}
|
||||
MessageChannel input = ctx.getBean("input", MessageChannel.class);
|
||||
input.send(MessageBuilder.withPayload("Test").build());
|
||||
QueueChannel replies = ctx.getBean("replies", QueueChannel.class);
|
||||
Message<?> message = replies.receive(10000);
|
||||
assertNotNull(message);
|
||||
assertEquals("Test", message.getPayload());
|
||||
for (int i = 0; i < 5; i++) {
|
||||
MessageChannel input = ctx.getBean("input", MessageChannel.class);
|
||||
input.send(MessageBuilder.withPayload("Test").build());
|
||||
QueueChannel replies = ctx.getBean("replies", QueueChannel.class);
|
||||
Message<?> message = replies.receive(10000);
|
||||
assertNotNull(message);
|
||||
assertEquals("Test", message.getPayload());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -817,7 +817,7 @@ public class TcpSendingMessageHandlerTests {
|
||||
ObjectOutputStream oos = new ObjectOutputStream(socket.getOutputStream());
|
||||
if (i == 100) {
|
||||
in = ois.readObject();
|
||||
System.out.println(in);
|
||||
// System.out.println(in);
|
||||
oos.writeObject("world!");
|
||||
ois = new ObjectInputStream(socket.getInputStream());
|
||||
oos = new ObjectOutputStream(socket.getOutputStream());
|
||||
@@ -849,17 +849,17 @@ public class TcpSendingMessageHandlerTests {
|
||||
QueueChannel channel = new QueueChannel();
|
||||
adapter.setOutputChannel(channel);
|
||||
assertTrue(latch.await(10, TimeUnit.SECONDS));
|
||||
for (int i = 0; i < 100; i++) {
|
||||
for (int i = 0; i < 1000; i++) {
|
||||
handler.handleMessage(MessageBuilder.withPayload("Test").build());
|
||||
}
|
||||
Set<String> results = new TreeSet<String>();
|
||||
for (int i = 0; i < 100; i++) {
|
||||
for (int i = 0; i < 1000; i++) {
|
||||
Message<?> mOut = channel.receive(10000);
|
||||
assertNotNull(mOut);
|
||||
results.add((String) mOut.getPayload());
|
||||
}
|
||||
// System.out.println(results);
|
||||
for (int i = 100; i < 200; i++) {
|
||||
for (int i = 100; i < 1100; i++) {
|
||||
assertTrue("Missing Reply" + i, results.remove("Reply" + i));
|
||||
}
|
||||
done.set(true);
|
||||
|
||||
Reference in New Issue
Block a user