Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace Exception By Warn Log In Case Of No Connection To Close #570

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -825,7 +825,11 @@ public boolean reset(long code, Throwable cause) {

@Override
public HttpConnection connection() {
throw new UnsupportedOperationException();
// Cited from API specification:
// @return the {@link HttpConnection} associated with this request
// As "no connection" is associated with this request, we return "no connection".
log.debug("There's no connection associated with this request.");
return null;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -371,12 +371,13 @@ public WriteStream<Buffer> drainHandler(@Nullable Handler<Void> handler) {
};

req.exceptionHandler(t -> {
RequestLoggerFactory
.getLogger(Forwarder.class, req)
.warn("Exception during forwarding - closing (forwarding) client connection", t);
log.info("Exception during forwarding - closing (forwarding) client connection", t);
HttpConnection connection = cReq.connection();
if (connection != null) {
connection.close();
} else {
log.warn("There's no connection we could close in {}, gateleen wishes your request a happy timeout ({})",
cReq.getClass(), req.uri());
}
});

Expand Down
Loading