Skip to content

Commit

Permalink
Merge #2742 into 2.0.0-M4
Browse files Browse the repository at this point in the history
  • Loading branch information
violetagg committed Mar 24, 2023
2 parents 24154ec + 0cfc731 commit b00cede
Showing 1 changed file with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,9 @@ public final void dispose() {

@Override
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 @@ -570,12 +573,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 b00cede

Please sign in to comment.