flume-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jar...@apache.org
Subject flume git commit: FLUME-2908: NetcatSource - SocketChannel not closed when session is broken
Date Thu, 05 May 2016 16:21:14 GMT
Repository: flume
Updated Branches:
  refs/heads/trunk e6df16d78 -> 46ae5accd


FLUME-2908: NetcatSource - SocketChannel not closed when session is broken

(Grant Henke via Jarek Jarcec Cecho)


Project: http://git-wip-us.apache.org/repos/asf/flume/repo
Commit: http://git-wip-us.apache.org/repos/asf/flume/commit/46ae5acc
Tree: http://git-wip-us.apache.org/repos/asf/flume/tree/46ae5acc
Diff: http://git-wip-us.apache.org/repos/asf/flume/diff/46ae5acc

Branch: refs/heads/trunk
Commit: 46ae5accd03e5b8b18d3e1fb52761c1df4e51e5a
Parents: e6df16d
Author: Jarek Jarcec Cecho <jarcec@apache.org>
Authored: Thu May 5 09:20:41 2016 -0700
Committer: Jarek Jarcec Cecho <jarcec@apache.org>
Committed: Thu May 5 09:20:41 2016 -0700

----------------------------------------------------------------------
 .../src/main/java/org/apache/flume/source/NetcatSource.java     | 5 +++++
 1 file changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flume/blob/46ae5acc/flume-ng-core/src/main/java/org/apache/flume/source/NetcatSource.java
----------------------------------------------------------------------
diff --git a/flume-ng-core/src/main/java/org/apache/flume/source/NetcatSource.java b/flume-ng-core/src/main/java/org/apache/flume/source/NetcatSource.java
index 61e3f90..9513902 100644
--- a/flume-ng-core/src/main/java/org/apache/flume/source/NetcatSource.java
+++ b/flume-ng-core/src/main/java/org/apache/flume/source/NetcatSource.java
@@ -357,6 +357,11 @@ public class NetcatSource extends AbstractSource implements Configurable,
         counterGroup.incrementAndGet("sessions.completed");
       } catch (IOException e) {
         counterGroup.incrementAndGet("sessions.broken");
+        try {
+          socketChannel.close();
+        } catch (IOException ex) {
+          logger.error("Unable to close socket channel. Exception follows.", ex);
+        }
       }
 
       logger.debug("Connection handler exiting");


Mime
View raw message