Author: mreutegg
Date: Mon Dec 11 12:49:17 2017
New Revision: 1817770

URL: http://svn.apache.org/viewvc?rev=1817770&view=rev
Log:
OAK-7044: Misleading log message by LeaseFailureHandler

Modified:
    
jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/ClusterNodeInfo.java
    
jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreService.java
    
jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/LeaseFailureHandler.java

Modified: 
jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/ClusterNodeInfo.java
URL: 
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/ClusterNodeInfo.java?rev=1817770&r1=1817769&r2=1817770&view=diff
==============================================================================
--- 
jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/ClusterNodeInfo.java
 (original)
+++ 
jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/ClusterNodeInfo.java
 Mon Dec 11 12:49:17 2017
@@ -302,7 +302,7 @@ public class ClusterNodeInfo {
      * OAK-2739 / OAK-3397 : once a lease check turns out negative, this flag
      * is set to prevent any further checks to succeed. Also, only the first
      * one to change this flag will take the appropriate action that results
-     * from a failed leaseCheck (which is currently to stop oak-core bundle)
+     * from a failed leaseCheck (which is currently to stop oak-store-document 
bundle)
      */
     private boolean leaseCheckFailed = false;
 
@@ -333,7 +333,10 @@ public class ClusterNodeInfo {
      */
     private boolean newEntry;
 
-    /** OAK-3397 / OAK-3400 : the LeaseFailureHandler is the one that actually 
stops the oak-core bundle (or does something else if necessary) **/
+    /**
+     * OAK-3397 / OAK-3400 : the LeaseFailureHandler is the one that actually
+     * stops the oak-store-document bundle (or does something else if 
necessary)
+     */
     private LeaseFailureHandler leaseFailureHandler;
 
     private ClusterNodeInfo(int id, DocumentStore store, String machineId, 
String instanceId, ClusterNodeState state,
@@ -733,7 +736,7 @@ public class ClusterNodeInfo {
                 ", lease check end time (leaseEndTime-leaseFailureMargin): 
"+(leaseEndTime - leaseFailureMargin)+
                 ", now: "+now+
                 ", remaining: "+((leaseEndTime - leaseFailureMargin) - now)+
-                ") Need to stop oak-core/DocumentNodeStoreService.";
+                ") Need to stop oak-store-document/DocumentNodeStoreService.";
         LOG.error(errorMsg);
 
         handleLeaseFailure(errorMsg);
@@ -741,7 +744,7 @@ public class ClusterNodeInfo {
 
     private void handleLeaseFailure(final String errorMsg) {
         // OAK-3397 : unlike previously, when the lease check fails we should 
not
-        // do a hard System exit here but rather stop the oak-core bundle
+        // do a hard System exit here but rather stop the oak-store-document 
bundle
         // (or if that fails just deactivate DocumentNodeStore) - with the
         // goals to prevent this instance to continue to operate
         // give that a lease failure is a strong indicator of a faulty

Modified: 
jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreService.java
URL: 
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreService.java?rev=1817770&r1=1817769&r2=1817770&view=diff
==============================================================================
--- 
jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreService.java
 (original)
+++ 
jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreService.java
 Mon Dec 11 12:49:17 2017
@@ -439,15 +439,16 @@ public class DocumentNodeStoreService {
 
                     @Override
                     public void handleLeaseFailure() {
+                        Bundle bundle = context.getBundleContext().getBundle();
+                        String bundleName = bundle.getSymbolicName();
                         try {
-                            // plan A: try stopping oak-core
-                            log.error("handleLeaseFailure: stopping 
oak-core...");
-                            Bundle bundle = 
context.getBundleContext().getBundle();
+                            // plan A: try stopping oak-store-document
+                            log.error("handleLeaseFailure: stopping {}...", 
bundleName);
                             bundle.stop(Bundle.STOP_TRANSIENT);
-                            log.error("handleLeaseFailure: stopped oak-core.");
+                            log.error("handleLeaseFailure: stopped {}.", 
bundleName);
                             // plan A worked, perfect!
                         } catch (BundleException e) {
-                            log.error("handleLeaseFailure: exception while 
stopping oak-core: "+e, e);
+                            log.error("handleLeaseFailure: exception while 
stopping " + bundleName + ": " + e, e);
                             // plan B: stop only DocumentNodeStoreService (to 
stop the background threads)
                             log.error("handleLeaseFailure: stopping 
DocumentNodeStoreService...");
                             
context.disableComponent(DocumentNodeStoreService.class.getName());

Modified: 
jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/LeaseFailureHandler.java
URL: 
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/LeaseFailureHandler.java?rev=1817770&r1=1817769&r2=1817770&view=diff
==============================================================================
--- 
jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/LeaseFailureHandler.java
 (original)
+++ 
jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/LeaseFailureHandler.java
 Mon Dec 11 12:49:17 2017
@@ -24,7 +24,7 @@ package org.apache.jackrabbit.oak.plugin
  * When ClusterNodeInfo does not have such a LeaseFailureHandler, 
  * the only thing it does is fail every subsequent access with
  * an exception - but it doesn't do fancy things like stopping
- * the oak-core bundle etc. Such an operation must be provided
+ * the oak-store-document bundle etc. Such an operation must be provided
  * in a LeaseFailureHandler.
  */
 public interface LeaseFailureHandler {
@@ -34,7 +34,7 @@ public interface LeaseFailureHandler {
      * failure and has started preventing any further access
      * to the DocumentStore by throwing exceptions - what's
      * now left is any further actions that should be taken
-     * such as eg stopping the oak-core bundle. This part
+     * such as eg stopping the oak-store-document bundle. This part
      * however is optional from the ClusterNodeInfo's pov
      * and must be done by here in this LeaseFailureHandler.
      */


Reply via email to