You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by sb...@apache.org on 2017/04/24 15:04:03 UTC

[40/50] [abbrv] ignite git commit: ignite-3054 - Fix closuing server channel

ignite-3054 - Fix closuing server channel


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/229880c6
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/229880c6
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/229880c6

Branch: refs/heads/ignite-3054
Commit: 229880c6516dd8a033291863aa14e5d23f59d9b9
Parents: 698728b
Author: dkarachentsev <dk...@gridgain.com>
Authored: Thu Dec 15 13:20:02 2016 +0300
Committer: dkarachentsev <dk...@gridgain.com>
Committed: Thu Dec 15 13:20:02 2016 +0300

----------------------------------------------------------------------
 .../org/apache/ignite/spi/discovery/tcp/ServerImpl.java     | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/229880c6/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java
index 8af1e91..a0c862b 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java
@@ -5616,7 +5616,12 @@ class ServerImpl extends TcpDiscoveryImpl {
                 }
 
                 // If free port wasn't found.
-                U.closeQuiet(srvCh);
+                try {
+                    srvCh.close();
+                }
+                catch (IOException e) {
+                    log.error("Unable close channel ", e);
+                }
             }
 
             throw new IgniteSpiException("Failed to bind TCP server socket (possibly all ports in range " +
@@ -5636,6 +5641,8 @@ class ServerImpl extends TcpDiscoveryImpl {
                 srvCh.setOption(StandardSocketOptions.SO_REUSEADDR, true);
             }
             catch (IOException e) {
+                U.closeQuiet(srvCh);
+
                 throw new IgniteSpiException("Failed to open socket channel", e);
             }
         }