You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by kw...@apache.org on 2016/12/15 13:52:27 UTC

svn commit: r1774446 - in /qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server: model/adapter/FileBasedGroupProviderImpl.java util/HousekeepingExecutor.java virtualhost/AbstractVirtualHost.java

Author: kwall
Date: Thu Dec 15 13:52:26 2016
New Revision: 1774446

URL: http://svn.apache.org/viewvc?rev=1774446&view=rev
Log:
QPID-7560: [Java Broker] Remove duplicate state transition.

Also interpret a negative housekeeping interval as 'disable housekeeping' rather than causing an exception.

Modified:
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/adapter/FileBasedGroupProviderImpl.java
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/util/HousekeepingExecutor.java
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/virtualhost/AbstractVirtualHost.java

Modified: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/adapter/FileBasedGroupProviderImpl.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/adapter/FileBasedGroupProviderImpl.java?rev=1774446&r1=1774445&r2=1774446&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/adapter/FileBasedGroupProviderImpl.java (original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/adapter/FileBasedGroupProviderImpl.java Thu Dec 15 13:52:26 2016
@@ -253,7 +253,7 @@ public class FileBasedGroupProviderImpl
         {
             if (getAncestor(SystemConfig.class).isManagementMode())
             {
-                        LOGGER.warn("Failed to activate group provider: " + getName());
+                LOGGER.warn("Failed to activate group provider: {}", getName());
             }
             else
             {

Modified: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/util/HousekeepingExecutor.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/util/HousekeepingExecutor.java?rev=1774446&r1=1774445&r2=1774446&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/util/HousekeepingExecutor.java (original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/util/HousekeepingExecutor.java Thu Dec 15 13:52:26 2016
@@ -83,7 +83,7 @@ public class HousekeepingExecutor extend
         }
         if (t != null)
         {
-            LOGGER.error("Houskeeping task threw an exception:", t);
+            LOGGER.error("Housekeeping task threw an exception:", t);
 
             final Thread.UncaughtExceptionHandler uncaughtExceptionHandler = Thread.getDefaultUncaughtExceptionHandler();
             if (uncaughtExceptionHandler != null)

Modified: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/virtualhost/AbstractVirtualHost.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/virtualhost/AbstractVirtualHost.java?rev=1774446&r1=1774445&r2=1774446&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/virtualhost/AbstractVirtualHost.java (original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/virtualhost/AbstractVirtualHost.java Thu Dec 15 13:52:26 2016
@@ -1133,7 +1133,7 @@ public abstract class AbstractVirtualHos
      */
     private void initialiseHouseKeeping(long period)
     {
-        if (period != 0L)
+        if (period > 0L)
         {
             scheduleHouseKeepingTask(period, new VirtualHostHouseKeepingTask());
         }
@@ -2523,6 +2523,7 @@ public abstract class AbstractVirtualHos
         }
 
         // propagate any exception thrown during recovery into HouseKeepingTaskExecutor to handle them accordingly
+        // TODO if message recovery fails we ought to be transitioning the VH into ERROR and releasing the thread-pools etc.
         final ListenableFuture<Void> recoveryResult = _messageStoreRecoverer.recover(this);
         recoveryResult.addListener(new Runnable()
         {
@@ -2555,12 +2556,13 @@ public abstract class AbstractVirtualHos
 
     protected void startFileSystemSpaceChecking()
     {
+        long housekeepingCheckPeriod = getHousekeepingCheckPeriod();
         File storeLocationAsFile = _messageStore.getStoreLocationAsFile();
-        if (storeLocationAsFile != null && _fileSystemMaxUsagePercent > 0)
+        if (storeLocationAsFile != null && _fileSystemMaxUsagePercent > 0 && housekeepingCheckPeriod > 0)
         {
             _fileSystemSpaceChecker.setFileSystem(storeLocationAsFile);
 
-            scheduleHouseKeepingTask(getHousekeepingCheckPeriod(), _fileSystemSpaceChecker);
+            scheduleHouseKeepingTask(housekeepingCheckPeriod, _fileSystemSpaceChecker);
         }
     }
 
@@ -2570,7 +2572,7 @@ public abstract class AbstractVirtualHos
         return getBroker().getConnectionMetaData();
     }
 
-    @StateTransition( currentState = { State.STOPPED, State.ERRORED }, desiredState = State.ACTIVE )
+    @StateTransition( currentState = { State.STOPPED }, desiredState = State.ACTIVE )
     private ListenableFuture<Void> onRestart()
     {
         resetStatistics();



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org