Skip to content

Commit

Permalink
Add DEBUG log for ServerTransport#disposeNow (#2742)
Browse files Browse the repository at this point in the history
Extend the comments for channel#close invocation
  • Loading branch information
violetagg authored Mar 24, 2023
1 parent 508fb0a commit f9ad617
Showing 1 changed file with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,9 @@ public final void dispose() {
@Override
@SuppressWarnings("FutureReturnValueIgnored")
public void disposeNow(Duration timeout) {
if (log.isDebugEnabled()) {
log.debug(format(channel(), "Server is about to be disposed with timeout: {}"), timeout);
}
if (isDisposed()) {
return;
}
Expand All @@ -554,12 +557,17 @@ public void disposeNow(Duration timeout) {
Channel channel = entry.getKey();
List<Mono<Void>> monos = entry.getValue();
if (monos.isEmpty()) {
//"FutureReturnValueIgnored" this is deliberate
// At this point there are no running requests for this channel
// "FutureReturnValueIgnored" this is deliberate
channel.close();
}
else {
//"FutureReturnValueIgnored" this is deliberate
terminateSignals = Mono.when(monos).doFinally(sig -> channel.close()).and(terminateSignals);
terminateSignals =
Mono.when(monos)
// At this point there are no running requests for this channel
// "FutureReturnValueIgnored" this is deliberate
.doFinally(sig -> channel.close())
.and(terminateSignals);
}
}
}
Expand Down

0 comments on commit f9ad617

Please sign in to comment.