qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kw...@apache.org
Subject svn commit: r1556287 - in /qpid/branches/0.26/qpid: ./ java/ java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/ java/broker-core/ java/broker-core/src/main/java/org/apache/qpid/server/store/
Date Tue, 07 Jan 2014 17:47:25 GMT
Author: kwall
Date: Tue Jan  7 17:47:24 2014
New Revision: 1556287

URL: http://svn.apache.org/r1556287
Log:
QPID-5211 - Broker logs spurious "No valid transition from state CLOSED to state CLOSING"
on shutdown.

Merged from trunk with the following commands:

svn merge -c 1555690 https://svn.apache.org/repos/asf/qpid/trunk/qpid
svn merge -c 1555695 https://svn.apache.org/repos/asf/qpid/trunk/qpid


Modified:
    qpid/branches/0.26/qpid/   (props changed)
    qpid/branches/0.26/qpid/java/   (props changed)
    qpid/branches/0.26/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/AbstractBDBMessageStore.java
    qpid/branches/0.26/qpid/java/broker-core/   (props changed)
    qpid/branches/0.26/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/AbstractJDBCMessageStore.java
  (contents, props changed)

Propchange: qpid/branches/0.26/qpid/
------------------------------------------------------------------------------
  Merged /qpid/trunk/qpid:r1555690,1555695

Propchange: qpid/branches/0.26/qpid/java/
------------------------------------------------------------------------------
  Merged /qpid/trunk/qpid/java:r1555690,1555695

Modified: qpid/branches/0.26/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/AbstractBDBMessageStore.java
URL: http://svn.apache.org/viewvc/qpid/branches/0.26/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/AbstractBDBMessageStore.java?rev=1556287&r1=1556286&r2=1556287&view=diff
==============================================================================
--- qpid/branches/0.26/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/AbstractBDBMessageStore.java
(original)
+++ qpid/branches/0.26/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/AbstractBDBMessageStore.java
Tue Jan  7 17:47:24 2014
@@ -25,6 +25,7 @@ import com.sleepycat.bind.tuple.IntegerB
 import com.sleepycat.bind.tuple.LongBinding;
 import com.sleepycat.je.*;
 import com.sleepycat.je.Transaction;
+
 import java.io.File;
 import java.lang.ref.SoftReference;
 import java.nio.ByteBuffer;
@@ -37,7 +38,9 @@ import java.util.List;
 import java.util.Map;
 import java.util.Random;
 import java.util.UUID;
+import java.util.concurrent.atomic.AtomicBoolean;
 import java.util.concurrent.atomic.AtomicLong;
+
 import org.apache.commons.configuration.Configuration;
 import org.apache.commons.configuration.ConfigurationException;
 import org.apache.log4j.Logger;
@@ -75,6 +78,8 @@ public abstract class AbstractBDBMessage
         put(EnvironmentConfig.STATS_COLLECT, "false"); // Turn off stats generation - feature
introduced (and on by default) from BDB JE 5.0.84
     }});
 
+    private final AtomicBoolean _closed = new AtomicBoolean(false);
+
     private Environment _environment;
 
     private static String CONFIGURED_OBJECTS = "CONFIGURED_OBJECTS";
@@ -384,9 +389,12 @@ public abstract class AbstractBDBMessage
      */
     public void close() throws Exception
     {
-        _stateManager.attainState(State.CLOSING);
-        closeInternal();
-        _stateManager.attainState(State.CLOSED);
+        if (_closed.compareAndSet(false, true))
+        {
+            _stateManager.attainState(State.CLOSING);
+            closeInternal();
+            _stateManager.attainState(State.CLOSED);
+        }
     }
 
     protected void closeInternal() throws Exception

Propchange: qpid/branches/0.26/qpid/java/broker-core/
------------------------------------------------------------------------------
  Merged /qpid/trunk/qpid/java/broker-core:r1555690,1555695

Modified: qpid/branches/0.26/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/AbstractJDBCMessageStore.java
URL: http://svn.apache.org/viewvc/qpid/branches/0.26/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/AbstractJDBCMessageStore.java?rev=1556287&r1=1556286&r2=1556287&view=diff
==============================================================================
--- qpid/branches/0.26/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/AbstractJDBCMessageStore.java
(original)
+++ qpid/branches/0.26/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/AbstractJDBCMessageStore.java
Tue Jan  7 17:47:24 2014
@@ -79,7 +79,7 @@ abstract public class AbstractJDBCMessag
     private static final int DB_VERSION = 7;
 
     private final AtomicLong _messageId = new AtomicLong(0);
-    private AtomicBoolean _closed = new AtomicBoolean(false);
+    private final AtomicBoolean _closed = new AtomicBoolean(false);
 
     private static final String CREATE_DB_VERSION_TABLE = "CREATE TABLE "+ DB_VERSION_TABLE_NAME
+ " ( version int not null )";
     private static final String INSERT_INTO_DB_VERSION = "INSERT INTO "+ DB_VERSION_TABLE_NAME
+ " ( version ) VALUES ( ? )";
@@ -670,12 +670,14 @@ abstract public class AbstractJDBCMessag
     @Override
     public void close() throws Exception
     {
-        _closed.getAndSet(true);
-        _stateManager.attainState(State.CLOSING);
+        if (_closed.compareAndSet(false, true))
+        {
+            _stateManager.attainState(State.CLOSING);
 
-        doClose();
+            doClose();
 
-        _stateManager.attainState(State.CLOSED);
+            _stateManager.attainState(State.CLOSED);
+        }
     }
 
 

Propchange: qpid/branches/0.26/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/AbstractJDBCMessageStore.java
------------------------------------------------------------------------------
  Merged /qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/AbstractJDBCMessageStore.java:r1555690,1555695



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


Mime
View raw message