karaf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject git commit: [KARAF-3325] Add a workaround to avoid sudden shutdown
Date Fri, 24 Oct 2014 11:12:57 GMT
Repository: karaf
Updated Branches:
  refs/heads/karaf-2.x ee490fb66 -> 644f55238


[KARAF-3325] Add a workaround to avoid sudden shutdown


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

Branch: refs/heads/karaf-2.x
Commit: 644f55238f5d99fd838ed665452292d88c27b38a
Parents: ee490fb
Author: Guillaume Nodet <gnodet@gmail.com>
Authored: Fri Oct 24 12:20:24 2014 +0200
Committer: Guillaume Nodet <gnodet@gmail.com>
Committed: Fri Oct 24 13:12:41 2014 +0200

----------------------------------------------------------------------
 main/src/main/java/org/apache/karaf/main/Main.java | 9 +++++++++
 1 file changed, 9 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/karaf/blob/644f5523/main/src/main/java/org/apache/karaf/main/Main.java
----------------------------------------------------------------------
diff --git a/main/src/main/java/org/apache/karaf/main/Main.java b/main/src/main/java/org/apache/karaf/main/Main.java
index 6ff0165..d3b6cd3 100644
--- a/main/src/main/java/org/apache/karaf/main/Main.java
+++ b/main/src/main/java/org/apache/karaf/main/Main.java
@@ -1590,10 +1590,19 @@ public class Main {
                     // Wait for the next connection
                     Socket socket = null;
                     InputStream stream = null;
+                    long acceptStartTime = System.currentTimeMillis();
                     try {
                         socket = shutdownSocket.accept();
                         socket.setSoTimeout(10 * 1000);  // Ten seconds
                         stream = socket.getInputStream();
+                    } catch (SocketTimeoutException ste) {
+                        // This should never happen but bug 3325 suggests that it does
+                        LOG.log(Level.WARNING, "Karaf shutdown socket: "
+                                           + "The socket listening for the shutdown command
experienced "
+                                           + "an unexpected timeout "
+                                           + "[" + (System.currentTimeMillis() - acceptStartTime)
+ "] milliseconds "
+                                           + "after the call to accept(). Is this an instance
of bug 3325?", ste);
+                        continue;
                     } catch (AccessControlException ace) {
                         LOG.log(Level.WARNING, "Karaf shutdown socket: security exception:
"
                                            + ace.getMessage(), ace);


Mime
View raw message