You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@karaf.apache.org by ff...@apache.org on 2017/07/13 06:45:01 UTC

karaf git commit: [KARAF-5247]java.lang.InterruptedException after logout command in shell

Repository: karaf
Updated Branches:
  refs/heads/karaf-4.1.x 7d0cc1df8 -> 8fd6f4a3e


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

(cherry picked from commit 0f2b18176d551619e846282e3faaed6f646b7e51)


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

Branch: refs/heads/karaf-4.1.x
Commit: 8fd6f4a3e5ff2ca3eb87fb2032fe6be34bb6971a
Parents: 7d0cc1d
Author: Freeman Fang <fr...@gmail.com>
Authored: Thu Jul 13 14:43:41 2017 +0800
Committer: Freeman Fang <fr...@gmail.com>
Committed: Thu Jul 13 14:44:51 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/8fd6f4a3/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();