sashapolo commented on code in PR #3009:
URL: https://github.com/apache/ignite-3/pull/3009#discussion_r1446996982
##########
modules/network/src/integrationTest/java/org/apache/ignite/internal/network/netty/ItConnectionManagerTest.java:
##########
@@ -240,20 +242,18 @@ public void testCanReconnectAfterFail() throws Exception {
ConnectionManagerWrapper manager2 = startManager(port2);
NettySender sender = manager1.openChannelTo(manager2).get(3,
TimeUnit.SECONDS);
+ assertNotNull(sender);
TestMessage testMessage =
messageFactory.testMessage().msg(msgText).build();
manager2.close();
NettySender finalSender = sender;
- assertThrows(ClosedChannelException.class, () -> {
- try {
- finalSender.send(new OutNetworkObject(testMessage,
emptyList())).get(3, TimeUnit.SECONDS);
- } catch (ExecutionException e) {
- throw e.getCause();
- }
- });
+ assertThrowsWithCause(
Review Comment:
Sorry, I just noticed that `send` returns a Future, maybe we should use
`willThrowWithCauseOrSuppressed` instead?
##########
modules/network/src/main/java/org/apache/ignite/internal/network/netty/ConnectionManager.java:
##########
@@ -434,14 +436,10 @@ public void stop() {
assert stopping.get();
- Stream<CompletableFuture<Void>> stopFutures = Stream.concat(
- Stream.concat(
- clients.values().stream().map(NettyClient::stop),
- Stream.of(server.stop())
- ),
- channels.values().stream().map(NettySender::closeAsync)
- );
- stopFutures = Stream.concat(stopFutures,
Stream.of(disposeDescriptors()));
+ List<CompletableFuture<Void>> stopFutures =
clients.values().stream().map(NettyClient::stop).collect(toList());
Review Comment:
Strictly speaking, it is incorrect to modify a list returned by `toList()`,
it's better to create an `ArrayList` explicitly and use `forEach(list::add)`,
for example
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]