karaf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ff...@apache.org
Subject karaf git commit: [KARAF-5247]java.lang.InterruptedException after logout command in shell
Date Thu, 13 Jul 2017 06:45:01 GMT
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 <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: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();


Mime
View raw message