sashapolo commented on a change in pull request #102:
URL: https://github.com/apache/ignite-3/pull/102#discussion_r630790411
##########
File path:
modules/network/src/test/java/org/apache/ignite/network/internal/netty/InboundDecoderTest.java
##########
@@ -87,6 +92,35 @@ public void test(long seed) throws Exception {
assertEquals(msg, output);
}
+ /**
+ * Tests that an {@link InboundDecoder} doesn't hang if it encounters a
byte buffer with only partially written
+ * header.
+ *
+ * @throws InterruptedException If failed.
+ */
+ @Test
+ public void testPartialHeader() throws InterruptedException {
+ var registry = new MessageSerializationRegistry();
+
+ var channel = new EmbeddedChannel(new InboundDecoder(registry));
+
+ ByteBuf buffer = allocator.buffer();
+
+ buffer.writeByte(1);
+
+ var latch = new CountDownLatch(1);
+
+ new Thread(() -> {
Review comment:
Can be written shorter:
```
CompletableFuture
.runAsync(() -> {
channel.writeInbound(buffer);
channel.readInbound();
})
.get(3, TimeUnit.SECONDS);
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]