Skip to content
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 @@ -22,6 +22,7 @@
import org.elasticsearch.common.concurrent.CompletableContext;

import java.io.IOException;
import java.net.BindException;
import java.net.InetSocketAddress;
import java.net.ServerSocket;
import java.nio.channels.ServerSocketChannel;
Expand Down Expand Up @@ -78,7 +79,8 @@ protected void register() throws IOException {
rawChannel.bind(localAddress);
bindContext.complete(null);
} catch (IOException e) {
IOException exception = new IOException("Failed to bind server socket channel {localAddress=" + localAddress + "}.", e);
BindException exception = new BindException("Failed to bind server socket channel {localAddress=" + localAddress + "}.");
exception.initCause(e);
bindContext.completeExceptionally(exception);
throw exception;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,11 @@ public void onException(TcpChannel channel, Exception e) {
}

protected void onServerException(TcpServerChannel channel, Exception e) {
logger.error(new ParameterizedMessage("exception from server channel caught on transport layer [channel={}]", channel), e);
if (e instanceof BindException) {
logger.trace(() -> new ParameterizedMessage("bind exception from server channel caught on transport layer [{}]", channel), e);
} else {
logger.error(new ParameterizedMessage("exception from server channel caught on transport layer [{}]", channel), e);
}
}

protected void serverAcceptedChannel(TcpChannel channel) {
Expand Down