Skip to content
Open
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
15 changes: 10 additions & 5 deletions src/main/java/org/logstash/beats/BeatsHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -92,18 +92,23 @@ public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws E
}
} else {
final Throwable realCause = extractCause(cause, 0);
if (logger.isDebugEnabled()) {
Comment thread
ash-darin marked this conversation as resolved.
logger.info(format("Handling exception: " + cause + " (caused by: " + realCause + ")"), cause);
} else {
logger.info(format("Handling exception: " + cause + " (caused by: " + realCause + ")"));
}
// when execution tasks rejected, no need to forward the exception to netty channel handlers
if (cause instanceof RejectedExecutionException) {
if (logger.isDebugEnabled()) {
Comment thread
ash-darin marked this conversation as resolved.
logger.info(format("Handling exception: " + cause + " (caused by: " + realCause + ")"), cause);
} else {
logger.info(format("Handling exception: " + cause + " (caused by: " + realCause + ")"));
}
// we no longer have event executors available since they are terminated, mostly by shutdown process
if (Objects.nonNull(cause.getMessage()) && cause.getMessage().contains(executorTerminatedMessage)) {
this.isQuietPeriod.compareAndSet(false, true);
}
} else {
if (logger.isDebugEnabled()) {
Comment thread
ash-darin marked this conversation as resolved.
logger.warn(format("Unhandled exception: " + cause + " (caused by: " + realCause + ")"), cause);
} else {
logger.warn(format("Unhandled exception: " + cause + " (caused by: " + realCause + ")"));
}
super.exceptionCaught(ctx, cause);
}
}
Expand Down