Skip to content

Commit f9ad617

Browse files
authored
Add DEBUG log for ServerTransport#disposeNow (#2742)
Extend the comments for channel#close invocation
1 parent 508fb0a commit f9ad617

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

reactor-netty-core/src/main/java/reactor/netty/transport/ServerTransport.java

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -530,6 +530,9 @@ public final void dispose() {
530530
@Override
531531
@SuppressWarnings("FutureReturnValueIgnored")
532532
public void disposeNow(Duration timeout) {
533+
if (log.isDebugEnabled()) {
534+
log.debug(format(channel(), "Server is about to be disposed with timeout: {}"), timeout);
535+
}
533536
if (isDisposed()) {
534537
return;
535538
}
@@ -554,12 +557,17 @@ public void disposeNow(Duration timeout) {
554557
Channel channel = entry.getKey();
555558
List<Mono<Void>> monos = entry.getValue();
556559
if (monos.isEmpty()) {
557-
//"FutureReturnValueIgnored" this is deliberate
560+
// At this point there are no running requests for this channel
561+
// "FutureReturnValueIgnored" this is deliberate
558562
channel.close();
559563
}
560564
else {
561-
//"FutureReturnValueIgnored" this is deliberate
562-
terminateSignals = Mono.when(monos).doFinally(sig -> channel.close()).and(terminateSignals);
565+
terminateSignals =
566+
Mono.when(monos)
567+
// At this point there are no running requests for this channel
568+
// "FutureReturnValueIgnored" this is deliberate
569+
.doFinally(sig -> channel.close())
570+
.and(terminateSignals);
563571
}
564572
}
565573
}

0 commit comments

Comments
 (0)