karaf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ff...@apache.org
Subject [1/2] karaf git commit: [KARAF-5247]java.lang.InterruptedException after logout command in shell
Date Thu, 13 Jul 2017 06:44:21 GMT
Repository: karaf
Updated Branches:
  refs/heads/master 87e785bf6 -> 2e9505340


[KARAF-5247]java.lang.InterruptedException after logout command in shell


Project: http://git-wip-us.apache.org/repos/asf/karaf/repo
Commit: http://git-wip-us.apache.org/repos/asf/karaf/commit/0f2b1817
Tree: http://git-wip-us.apache.org/repos/asf/karaf/tree/0f2b1817
Diff: http://git-wip-us.apache.org/repos/asf/karaf/diff/0f2b1817

Branch: refs/heads/master
Commit: 0f2b18176d551619e846282e3faaed6f646b7e51
Parents: e409ee5
Author: Freeman Fang <freeman.fang@gmail.com>
Authored: Thu Jul 13 14:43:41 2017 +0800
Committer: Freeman Fang <freeman.fang@gmail.com>
Committed: Thu Jul 13 14:43:41 2017 +0800

----------------------------------------------------------------------
 .../apache/karaf/shell/impl/console/ConsoleSessionImpl.java  | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/karaf/blob/0f2b1817/shell/core/src/main/java/org/apache/karaf/shell/impl/console/ConsoleSessionImpl.java
----------------------------------------------------------------------
diff --git a/shell/core/src/main/java/org/apache/karaf/shell/impl/console/ConsoleSessionImpl.java
b/shell/core/src/main/java/org/apache/karaf/shell/impl/console/ConsoleSessionImpl.java
index b500e9f..66802e4 100644
--- a/shell/core/src/main/java/org/apache/karaf/shell/impl/console/ConsoleSessionImpl.java
+++ b/shell/core/src/main/java/org/apache/karaf/shell/impl/console/ConsoleSessionImpl.java
@@ -365,7 +365,13 @@ public class ConsoleSessionImpl implements Session {
                         session.getConsole().println(session.format(result, Converter.INSPECT));
                     }
                 } catch (Throwable t) {
-                    ShellUtil.logException(this, t);
+                    if (!(command.endsWith("logout") && t instanceof InterruptedException))
{
+                        //command logout will interrupt this seesion thread, so this exception
+                        //is expected, don't need log it as a error message
+                        ShellUtil.logException(this, t);
+                    } else {
+                        LOGGER.debug("a console session is closed as the peer just logout");
+                    }
                 }
             }
             close();


Mime
View raw message