Skip to content

Commit

Permalink
Do not log ClosedChannelExceptions (micronaut-projects#11529)
Browse files Browse the repository at this point in the history
Also fix duplicate completion in this case.
  • Loading branch information
yawkat authored Jan 22, 2025
1 parent cff9539 commit 25c76e8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -566,6 +566,7 @@ void discard() {

@Override
void handleUpstreamError(Throwable cause) {
inboundHandler = droppingInboundHandler;
dest.error(cause);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ class FuzzyInputSpec extends Specification {
Base64.decoder.decode("UyAvIFAvMC4xMQpjb250ZW50LWxlbmd0aDo0ClRyYW5zZmVyLUVuY29kaW5nOmRlZmxhdGUKCi+5RVAyIPwgSC8xLjEK"),
Base64.decoder.decode("cA1ACUhUVFAvOC4wCkhvc3Q6OgpPcmlnaW46Cgo="),
Base64.decoder.decode("SEVDc3QNQP/9P/8JSFRUUC8wLjEKZXB0OgoKcG9zdA1A/T/9Oi8v/y9lY2hvLXB1Ymxpc2hlcglIVFRQLzAuMQp0OgpDb250ZW50LUxlbmd0aDo1Cgr/"),
Base64.decoder.decode("SEVDRCBIIEhUVFAvMS4wCiY6MwoKcG9zdA1A//0//wlIVFRQLzAuMQplcHQ6Cgpwb3N0DUD9P/06Ly//L2VjaG8tcHVibGlzaGVyCUhUVFAvMC4xCnQ6CkNvbnRlbnQtTGVuZ3RoOjUKCv8="),
]
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
import reactor.core.scheduler.Schedulers;

import java.io.IOException;
import java.nio.channels.ClosedChannelException;
import java.time.LocalDateTime;
import java.util.Iterator;
import java.util.List;
Expand Down Expand Up @@ -273,6 +274,9 @@ void logException(Throwable cause) {
}

static boolean isIgnorable(Throwable cause) {
if (cause instanceof ClosedChannelException) {
return true;
}
String message = cause.getMessage();
return cause instanceof IOException && message != null && IGNORABLE_ERROR_MESSAGE.matcher(message).matches();
}
Expand Down

0 comments on commit 25c76e8

Please sign in to comment.