Skip to content

Commit 2401ca5

Browse files
authored
reduce error logging on connection resets (#214)
log "Connection reset" error in INFO level Fixed: #215
1 parent 4f8c94c commit 2401ca5

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## 6.3.4
2+
- Fix: reduce error logging (to info level) on connection resets [#214](https://github.com/logstash-plugins/logstash-input-tcp/pull/214)
3+
14
## 6.3.3
25
- bump netty to 4.1.93 [#212](https://github.com/logstash-plugins/logstash-input-tcp/pull/212)
36

src/main/java/org/logstash/tcp/InputLoop.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,8 @@ private static final class DecoderAdapter extends ChannelInboundHandlerAdapter {
188188
*/
189189
private final Logger logger;
190190

191+
private static final String CONNECTION_RESET_ERROR_MSG = "Connection reset";
192+
191193
/**
192194
* Ctor.
193195
* @param decoder {@link Decoder} provided by JRuby.
@@ -221,10 +223,7 @@ public void exceptionCaught(final ChannelHandlerContext ctx, final Throwable cau
221223

222224
private boolean silentException(final Throwable ex) {
223225
if (ex instanceof IOException) {
224-
final String message = ex.getMessage();
225-
if ("Connection reset by peer".equals(message)) {
226-
return true;
227-
}
226+
return ex.getMessage() != null && ex.getMessage().contains(CONNECTION_RESET_ERROR_MSG);
228227
}
229228
return false;
230229
}

version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
6.3.3
1+
6.3.4

0 commit comments

Comments
 (0)