rhmessaging commits: r2152 - in store/branches/java/M2.1.x: java/bdbstore/src/test/java/org/etp/qpid/server and 1 other directories.
by rhmessaging-commits@lists.jboss.org
Author: ritchiem
Date: 2008-06-13 12:00:39 -0400 (Fri, 13 Jun 2008)
New Revision: 2152
Added:
store/branches/java/M2.1.x/java/bdbstore/src/test/java/org/etp/qpid/server/MessageReSendTest.java
Modified:
store/branches/java/M2.1.x/
store/branches/java/M2.1.x/java/bdbstore/src/test/java/org/etp/qpid/server/StoreContextRaceConditionTest.java
store/branches/java/M2.1.x/java/bdbstore/src/test/java/org/etp/qpid/testutil/BDBVMTestCase.java
Log:
Merged revisions 2151 via svnmerge from
https://svn.jboss.org/repos/rhmessaging/store/branches/java/M2.x
........
r2151 | ritchiem | 2008-06-13 16:54:41 +0100 (Fri, 13 Jun 2008) | 3 lines
QPID-1136 : New BDBTest to ensure that a the store doesn't accidentally restore messages that have been received and acked successfully.
Changes required to BDBVMTestCase that are not complete. Changing to the persistent environment-path will only work if the configuration is changed not the environment variable. i.e When QPID_WORK is set and the environment loaded
........
Property changes on: store/branches/java/M2.1.x
___________________________________________________________________
Name: svnmerge-integrated
- /store/branches/java/M2.x:1-2103
+ /store/branches/java/M2.x:1-2103,2151
Copied: store/branches/java/M2.1.x/java/bdbstore/src/test/java/org/etp/qpid/server/MessageReSendTest.java (from rev 2151, store/branches/java/M2.x/java/bdbstore/src/test/java/org/etp/qpid/server/MessageReSendTest.java)
===================================================================
--- store/branches/java/M2.1.x/java/bdbstore/src/test/java/org/etp/qpid/server/MessageReSendTest.java (rev 0)
+++ store/branches/java/M2.1.x/java/bdbstore/src/test/java/org/etp/qpid/server/MessageReSendTest.java 2008-06-13 16:00:39 UTC (rev 2152)
@@ -0,0 +1,234 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.etp.qpid.server;
+
+import org.apache.commons.configuration.Configuration;
+import org.apache.log4j.Level;
+import org.apache.log4j.Logger;
+import org.apache.qpid.server.registry.ApplicationRegistry;
+import org.apache.qpid.server.registry.ConfigurationFileApplicationRegistry;
+import org.apache.qpid.server.virtualhost.VirtualHostRegistry;
+import org.etp.qpid.testutil.BDBVMTestCase;
+
+import javax.jms.Connection;
+import javax.jms.ConnectionFactory;
+import javax.jms.JMSException;
+import javax.jms.Message;
+import javax.jms.MessageConsumer;
+import javax.jms.MessageProducer;
+import javax.jms.Queue;
+import javax.jms.Session;
+import javax.jms.TextMessage;
+import javax.naming.NamingException;
+import java.util.Map;
+
+public class MessageReSendTest extends BDBVMTestCase
+{
+ private static final Logger _logger = Logger.getLogger(MessageReSendTest.class);
+ private long _TimeToLive = 0L;
+ private static long SECOND = 1000L;
+
+ private static final String LOGGING_KEY = "amqj.logging.level";
+
+ private String _loggingOriginal;
+ ConfigurationFileApplicationRegistry _config;
+
+ public void setUp() throws Exception
+ {
+ //Disable the logging
+ _loggingOriginal = System.getProperty(LOGGING_KEY);
+ System.setProperty(LOGGING_KEY, Level.WARN.toString());
+
+ //Set the Work Directory
+ setupWorkDirectory();
+
+ Configuration configuration = ConfigurationFileApplicationRegistry.config(_persistentConfigFile);
+
+ //Disable management
+ configuration.setProperty("management.enabled", "false");
+
+ _config = new ConfigurationFileApplicationRegistry(configuration);
+
+ ApplicationRegistry.initialise(_config, 1);
+
+ //Remove the Vhosts we are not using to free up CPU from extra housekeeping threads.
+ VirtualHostRegistry vHostRegistry = ApplicationRegistry.getInstance().getVirtualHostRegistry();
+
+ _connections.put("connection2", "amqp://guest:guest@client2/test?brokerlist='vm://:2'");
+
+ //Create the Broker
+ super.setUp();
+
+ _queue = (Queue) _context.lookup("queue");
+ }
+
+ public void tearDown() throws Exception
+ {
+
+ if (_loggingOriginal != null)
+ {
+ System.setProperty(LOGGING_KEY, _loggingOriginal);
+ }
+ //set back to null
+
+ super.tearDown();
+ }
+
+ protected static final String MESSAGE_ID_PROPERTY = "MessageIDProperty";
+
+ protected Queue _queue;
+
+ protected void sendMessages(int num) throws JMSException
+ {
+ Connection producerConnection = null;
+ try
+ {
+ producerConnection = ((ConnectionFactory) _context.lookup("connection")).createConnection();
+ }
+ catch (NamingException e)
+ {
+ fail("Unable to lookup connection in JNDI.");
+ }
+
+ sendMessages(producerConnection, num);
+ }
+
+ protected void sendMessages(Connection producerConnection, int num) throws JMSException
+ {
+ Session producerSession = producerConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+ //Ensure _queue is created
+ producerSession.createConsumer(_queue).close();
+
+ MessageProducer producer = producerSession.createProducer(_queue);
+
+ producer.setTimeToLive(_TimeToLive);
+ producer.setDisableMessageTimestamp(false);
+
+ for (int messsageID = 0; messsageID < num; messsageID++)
+ {
+ TextMessage textMsg = producerSession.createTextMessage("Message " + messsageID);
+ textMsg.setIntProperty(MESSAGE_ID_PROPERTY, messsageID);
+ producer.send(textMsg);
+ }
+
+ producerConnection.close();
+ }
+
+ public void test() throws InterruptedException, NamingException, JMSException
+ {
+
+ //Send Message
+ sendMessages(createConnection(), 1);
+ System.err.println("SEND");
+
+ //Create Connection
+ Connection connection = createConnection();
+ System.err.println("RECEIVE");
+
+ //Receive Message
+ checkMessagesOnQueue(connection, _queue, 1);
+ //Close connections
+ connection.close();
+ System.err.println("VALIDATE");
+
+ //Reconnect and ensure message is gone
+ connection = createConnection();
+ checkMessagesOnQueue(connection, _queue, 0);
+ connection.close();
+
+ try
+ {
+ //restart broker
+ stopVMBroker(1);
+ System.err.println("START");
+ startVMBroker(1, _config);
+ }
+ catch (Exception e)
+ {
+ fail(e.getMessage());
+ }
+
+ //reconnect and ensure message is gone
+ connection = createConnection();
+ checkMessagesOnQueue(connection, _queue, 0);
+ connection.close();
+ }
+
+ private void checkMessagesOnQueue(Connection connection, Queue queue, int count)
+ {
+ try
+ {
+ Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+ MessageConsumer consumer = session.createConsumer(queue);
+
+ connection.start();
+
+ Message msg = consumer.receive(1000);
+
+ if (count > 0)
+ {
+ int received = 1;
+ while (received < count)
+ {
+ assertNotNull(msg);
+ assertEquals(received, msg.getIntProperty(MESSAGE_ID_PROPERTY));
+
+ //get next message
+ msg = consumer.receive(1000);
+ }
+
+ }
+ else
+ {
+ assertNull("Received Message when none expected", msg);
+ }
+ }
+ catch (JMSException e)
+ {
+ fail(e.getMessage());
+ }
+ }
+
+ private Connection createConnection()
+ {
+
+ try
+ {
+ try
+ {
+ return ((ConnectionFactory) _context.lookup("connection")).createConnection();
+ }
+ catch (NamingException e)
+ {
+ fail("Unable to lookup connection in JNDI.");
+ }
+ }
+ catch (JMSException e)
+ {
+ fail(e.getMessage());
+ }
+ return null;
+
+ }
+
+}
Modified: store/branches/java/M2.1.x/java/bdbstore/src/test/java/org/etp/qpid/server/StoreContextRaceConditionTest.java
===================================================================
--- store/branches/java/M2.1.x/java/bdbstore/src/test/java/org/etp/qpid/server/StoreContextRaceConditionTest.java 2008-06-13 15:54:41 UTC (rev 2151)
+++ store/branches/java/M2.1.x/java/bdbstore/src/test/java/org/etp/qpid/server/StoreContextRaceConditionTest.java 2008-06-13 16:00:39 UTC (rev 2152)
@@ -38,7 +38,6 @@
import javax.jms.Session;
import javax.jms.TextMessage;
import javax.naming.NamingException;
-import java.io.File;
public class StoreContextRaceConditionTest extends BDBVMTestCase
{
Modified: store/branches/java/M2.1.x/java/bdbstore/src/test/java/org/etp/qpid/testutil/BDBVMTestCase.java
===================================================================
--- store/branches/java/M2.1.x/java/bdbstore/src/test/java/org/etp/qpid/testutil/BDBVMTestCase.java 2008-06-13 15:54:41 UTC (rev 2151)
+++ store/branches/java/M2.1.x/java/bdbstore/src/test/java/org/etp/qpid/testutil/BDBVMTestCase.java 2008-06-13 16:00:39 UTC (rev 2152)
@@ -80,7 +80,14 @@
public void startVMBroker(int vmID, File configFile)
{
- testWork = BDB_WORK_PRE_TEST + "-" + vmID;
+ if (vmID != 1)
+ {
+ testWork = BDB_WORK_PRE_TEST + "-" + vmID;
+ }
+ else
+ {
+ testWork = BDB_WORK_PRE_TEST;
+ }
System.setProperty(BDB_WORK, testWork);
System.setProperty(QPID_WORK, testWork);
16 years, 6 months
rhmessaging commits: r2151 - in store/branches/java/M2.x/java/bdbstore/src/test/java/org/etp/qpid: testutil and 1 other directory.
by rhmessaging-commits@lists.jboss.org
Author: ritchiem
Date: 2008-06-13 11:54:41 -0400 (Fri, 13 Jun 2008)
New Revision: 2151
Added:
store/branches/java/M2.x/java/bdbstore/src/test/java/org/etp/qpid/server/MessageReSendTest.java
Modified:
store/branches/java/M2.x/java/bdbstore/src/test/java/org/etp/qpid/server/StoreContextRaceConditionTest.java
store/branches/java/M2.x/java/bdbstore/src/test/java/org/etp/qpid/testutil/BDBVMTestCase.java
Log:
QPID-1136 : New BDBTest to ensure that a the store doesn't accidentally restore messages that have been received and acked successfully.
Changes required to BDBVMTestCase that are not complete. Changing to the persistent environment-path will only work if the configuration is changed not the environment variable. i.e When QPID_WORK is set and the environment loaded
Added: store/branches/java/M2.x/java/bdbstore/src/test/java/org/etp/qpid/server/MessageReSendTest.java
===================================================================
--- store/branches/java/M2.x/java/bdbstore/src/test/java/org/etp/qpid/server/MessageReSendTest.java (rev 0)
+++ store/branches/java/M2.x/java/bdbstore/src/test/java/org/etp/qpid/server/MessageReSendTest.java 2008-06-13 15:54:41 UTC (rev 2151)
@@ -0,0 +1,234 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.etp.qpid.server;
+
+import org.apache.commons.configuration.Configuration;
+import org.apache.log4j.Level;
+import org.apache.log4j.Logger;
+import org.apache.qpid.server.registry.ApplicationRegistry;
+import org.apache.qpid.server.registry.ConfigurationFileApplicationRegistry;
+import org.apache.qpid.server.virtualhost.VirtualHostRegistry;
+import org.etp.qpid.testutil.BDBVMTestCase;
+
+import javax.jms.Connection;
+import javax.jms.ConnectionFactory;
+import javax.jms.JMSException;
+import javax.jms.Message;
+import javax.jms.MessageConsumer;
+import javax.jms.MessageProducer;
+import javax.jms.Queue;
+import javax.jms.Session;
+import javax.jms.TextMessage;
+import javax.naming.NamingException;
+import java.util.Map;
+
+public class MessageReSendTest extends BDBVMTestCase
+{
+ private static final Logger _logger = Logger.getLogger(MessageReSendTest.class);
+ private long _TimeToLive = 0L;
+ private static long SECOND = 1000L;
+
+ private static final String LOGGING_KEY = "amqj.logging.level";
+
+ private String _loggingOriginal;
+ ConfigurationFileApplicationRegistry _config;
+
+ public void setUp() throws Exception
+ {
+ //Disable the logging
+ _loggingOriginal = System.getProperty(LOGGING_KEY);
+ System.setProperty(LOGGING_KEY, Level.WARN.toString());
+
+ //Set the Work Directory
+ setupWorkDirectory();
+
+ Configuration configuration = ConfigurationFileApplicationRegistry.config(_persistentConfigFile);
+
+ //Disable management
+ configuration.setProperty("management.enabled", "false");
+
+ _config = new ConfigurationFileApplicationRegistry(configuration);
+
+ ApplicationRegistry.initialise(_config, 1);
+
+ //Remove the Vhosts we are not using to free up CPU from extra housekeeping threads.
+ VirtualHostRegistry vHostRegistry = ApplicationRegistry.getInstance().getVirtualHostRegistry();
+
+ _connections.put("connection2", "amqp://guest:guest@client2/test?brokerlist='vm://:2'");
+
+ //Create the Broker
+ super.setUp();
+
+ _queue = (Queue) _context.lookup("queue");
+ }
+
+ public void tearDown() throws Exception
+ {
+
+ if (_loggingOriginal != null)
+ {
+ System.setProperty(LOGGING_KEY, _loggingOriginal);
+ }
+ //set back to null
+
+ super.tearDown();
+ }
+
+ protected static final String MESSAGE_ID_PROPERTY = "MessageIDProperty";
+
+ protected Queue _queue;
+
+ protected void sendMessages(int num) throws JMSException
+ {
+ Connection producerConnection = null;
+ try
+ {
+ producerConnection = ((ConnectionFactory) _context.lookup("connection")).createConnection();
+ }
+ catch (NamingException e)
+ {
+ fail("Unable to lookup connection in JNDI.");
+ }
+
+ sendMessages(producerConnection, num);
+ }
+
+ protected void sendMessages(Connection producerConnection, int num) throws JMSException
+ {
+ Session producerSession = producerConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+ //Ensure _queue is created
+ producerSession.createConsumer(_queue).close();
+
+ MessageProducer producer = producerSession.createProducer(_queue);
+
+ producer.setTimeToLive(_TimeToLive);
+ producer.setDisableMessageTimestamp(false);
+
+ for (int messsageID = 0; messsageID < num; messsageID++)
+ {
+ TextMessage textMsg = producerSession.createTextMessage("Message " + messsageID);
+ textMsg.setIntProperty(MESSAGE_ID_PROPERTY, messsageID);
+ producer.send(textMsg);
+ }
+
+ producerConnection.close();
+ }
+
+ public void test() throws InterruptedException, NamingException, JMSException
+ {
+
+ //Send Message
+ sendMessages(createConnection(), 1);
+ System.err.println("SEND");
+
+ //Create Connection
+ Connection connection = createConnection();
+ System.err.println("RECEIVE");
+
+ //Receive Message
+ checkMessagesOnQueue(connection, _queue, 1);
+ //Close connections
+ connection.close();
+ System.err.println("VALIDATE");
+
+ //Reconnect and ensure message is gone
+ connection = createConnection();
+ checkMessagesOnQueue(connection, _queue, 0);
+ connection.close();
+
+ try
+ {
+ //restart broker
+ stopVMBroker(1);
+ System.err.println("START");
+ startVMBroker(1, _config);
+ }
+ catch (Exception e)
+ {
+ fail(e.getMessage());
+ }
+
+ //reconnect and ensure message is gone
+ connection = createConnection();
+ checkMessagesOnQueue(connection, _queue, 0);
+ connection.close();
+ }
+
+ private void checkMessagesOnQueue(Connection connection, Queue queue, int count)
+ {
+ try
+ {
+ Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+ MessageConsumer consumer = session.createConsumer(queue);
+
+ connection.start();
+
+ Message msg = consumer.receive(1000);
+
+ if (count > 0)
+ {
+ int received = 1;
+ while (received < count)
+ {
+ assertNotNull(msg);
+ assertEquals(received, msg.getIntProperty(MESSAGE_ID_PROPERTY));
+
+ //get next message
+ msg = consumer.receive(1000);
+ }
+
+ }
+ else
+ {
+ assertNull("Received Message when none expected", msg);
+ }
+ }
+ catch (JMSException e)
+ {
+ fail(e.getMessage());
+ }
+ }
+
+ private Connection createConnection()
+ {
+
+ try
+ {
+ try
+ {
+ return ((ConnectionFactory) _context.lookup("connection")).createConnection();
+ }
+ catch (NamingException e)
+ {
+ fail("Unable to lookup connection in JNDI.");
+ }
+ }
+ catch (JMSException e)
+ {
+ fail(e.getMessage());
+ }
+ return null;
+
+ }
+
+}
Property changes on: store/branches/java/M2.x/java/bdbstore/src/test/java/org/etp/qpid/server/MessageReSendTest.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Modified: store/branches/java/M2.x/java/bdbstore/src/test/java/org/etp/qpid/server/StoreContextRaceConditionTest.java
===================================================================
--- store/branches/java/M2.x/java/bdbstore/src/test/java/org/etp/qpid/server/StoreContextRaceConditionTest.java 2008-06-12 21:28:35 UTC (rev 2150)
+++ store/branches/java/M2.x/java/bdbstore/src/test/java/org/etp/qpid/server/StoreContextRaceConditionTest.java 2008-06-13 15:54:41 UTC (rev 2151)
@@ -38,7 +38,6 @@
import javax.jms.Session;
import javax.jms.TextMessage;
import javax.naming.NamingException;
-import java.io.File;
public class StoreContextRaceConditionTest extends BDBVMTestCase
{
Modified: store/branches/java/M2.x/java/bdbstore/src/test/java/org/etp/qpid/testutil/BDBVMTestCase.java
===================================================================
--- store/branches/java/M2.x/java/bdbstore/src/test/java/org/etp/qpid/testutil/BDBVMTestCase.java 2008-06-12 21:28:35 UTC (rev 2150)
+++ store/branches/java/M2.x/java/bdbstore/src/test/java/org/etp/qpid/testutil/BDBVMTestCase.java 2008-06-13 15:54:41 UTC (rev 2151)
@@ -80,7 +80,14 @@
public void startVMBroker(int vmID, File configFile)
{
- testWork = BDB_WORK_PRE_TEST + "-" + vmID;
+ if (vmID != 1)
+ {
+ testWork = BDB_WORK_PRE_TEST + "-" + vmID;
+ }
+ else
+ {
+ testWork = BDB_WORK_PRE_TEST;
+ }
System.setProperty(BDB_WORK, testWork);
System.setProperty(QPID_WORK, testWork);
16 years, 6 months
rhmessaging commits: r2150 - in store/trunk/cpp: tests and 1 other directory.
by rhmessaging-commits@lists.jboss.org
Author: gordonsim
Date: 2008-06-12 17:28:35 -0400 (Thu, 12 Jun 2008)
New Revision: 2150
Modified:
store/trunk/cpp/lib/BdbMessageStore.cpp
store/trunk/cpp/tests/system_test.sh
Log:
Remove store-async and store-force options
Modified: store/trunk/cpp/lib/BdbMessageStore.cpp
===================================================================
--- store/trunk/cpp/lib/BdbMessageStore.cpp 2008-06-10 21:10:49 UTC (rev 2149)
+++ store/trunk/cpp/lib/BdbMessageStore.cpp 2008-06-12 21:28:35 UTC (rev 2150)
@@ -1608,11 +1608,6 @@
("store-directory", qpid::optValue(storeDir, "DIR"),
"Store directory location for persistence (instead of using --data-dir value). "
"Must be supplied if --no-data-dir is also used.")
- ("store-async", qpid::optValue(storeAsync, "yes|no"),
- "Use async persistence storage - if store supports it, enables AIO using O_DIRECT.")
- ("store-force", qpid::optValue(storeForce, "yes|no"),
- "Force changing modes of store (from sync to async or visa versa). "
- "Will delete all existing data if mode is changed.")
("num-jfiles", qpid::optValue(numJrnlFiles, "N"),
"Number of files in persistence journal")
("jfile-size-pgs", qpid::optValue(jrnlFsizePgs, "N"),
Modified: store/trunk/cpp/tests/system_test.sh
===================================================================
--- store/trunk/cpp/tests/system_test.sh 2008-06-10 21:10:49 UTC (rev 2149)
+++ store/trunk/cpp/tests/system_test.sh 2008-06-12 21:28:35 UTC (rev 2150)
@@ -44,7 +44,7 @@
fail=0
# Run the tests with a given set of flags
-BROKER_OPTS="--no-module-dir --load-module=$LIBBDBSTORE --data-dir=$TMPDIR --auth=no --store-force=yes --wcache-page-size 16"
+BROKER_OPTS="--no-module-dir --load-module=$LIBBDBSTORE --data-dir=$TMPDIR --auth=no --wcache-page-size 16"
run_tests() {
for p in `seq 1 8`; do
$abs_srcdir/start_broker "$@" ${BROKER_OPTS} || return 1
@@ -54,8 +54,6 @@
}
echo 'Journal (AIO) persistence...'
-run_tests --store-async yes
-echo 'BDB persistence...'
-run_tests --store-async no
+run_tests
exit $fail
16 years, 6 months
rhmessaging commits: r2149 - mgmt/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2008-06-10 17:10:49 -0400 (Tue, 10 Jun 2008)
New Revision: 2149
Modified:
mgmt/cumin/python/cumin/widgets.py
Log:
Fix query constraint produced by the phase selector widget
Modified: mgmt/cumin/python/cumin/widgets.py
===================================================================
--- mgmt/cumin/python/cumin/widgets.py 2008-06-10 17:04:59 UTC (rev 2148)
+++ mgmt/cumin/python/cumin/widgets.py 2008-06-10 21:10:49 UTC (rev 2149)
@@ -370,12 +370,13 @@
phase = self.get(session)
if phase == "a":
- sql = "c.rec_time is null or " + \
- "c.rec_time > now() - interval '10 minutes'"
+ sql = "((c.rec_time is null or " + \
+ "c.rec_time > now() - interval '10 minutes')" + \
+ " and deletion_time is null)"
elif phase == "i":
- sql = "c.rec_time is null or " + \
- "((c.rec_time <= now() - interval '10 minutes'" + \
- " and deletion_time is null))"
+ sql = "((c.rec_time is null or " + \
+ "c.rec_time <= now() - interval '10 minutes')" + \
+ " and deletion_time is null)"
else:
sql = "deletion_time is not null"
16 years, 6 months
rhmessaging commits: r2148 - store/trunk/cpp.
by rhmessaging-commits@lists.jboss.org
Author: nunofsantos
Date: 2008-06-10 13:04:59 -0400 (Tue, 10 Jun 2008)
New Revision: 2148
Modified:
store/trunk/cpp/rhm.spec.in
Log:
remove rhmd.conf
Modified: store/trunk/cpp/rhm.spec.in
===================================================================
--- store/trunk/cpp/rhm.spec.in 2008-06-10 16:02:33 UTC (rev 2147)
+++ store/trunk/cpp/rhm.spec.in 2008-06-10 17:04:59 UTC (rev 2148)
@@ -51,6 +51,7 @@
rm -f %{buildroot}%_libdir/*.a
rm -f %{buildroot}%_libdir/*.la
rm -f %{buildroot}%_libdir/*.so*
+rm %{buildroot}%_sysconfdir/rhmd.conf
%clean
rm -rf %{buildroot}
@@ -63,7 +64,6 @@
%doc README COPYING
/usr/lib/qpidd/libbdbstore.so*
%attr(0775,qpidd,qpidd) %dir %_localstatedir/rhm
-%config(noreplace) %_sysconfdir/rhmd.conf
%changelog
16 years, 6 months
rhmessaging commits: r2147 - store/trunk/cpp/lib/jrnl.
by rhmessaging-commits@lists.jboss.org
Author: kpvdr
Date: 2008-06-10 12:02:33 -0400 (Tue, 10 Jun 2008)
New Revision: 2147
Modified:
store/trunk/cpp/lib/jrnl/jcntl.cpp
Log:
Fix for possible cause of BZ450706: "txtest causes segmentation fault". Found unsafe use of std::set::find() which could be called while other threads may be perfroming std::set::insert() or std::set::erase().
Modified: store/trunk/cpp/lib/jrnl/jcntl.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/jcntl.cpp 2008-06-10 14:30:38 UTC (rev 2146)
+++ store/trunk/cpp/lib/jrnl/jcntl.cpp 2008-06-10 16:02:33 UTC (rev 2147)
@@ -388,6 +388,7 @@
bool
jcntl::is_txn_synced(const std::string& xid)
{
+ slock s(&_wr_mutex);
return _wmgr.is_txn_synced(xid);
}
16 years, 6 months
rhmessaging commits: r2146 - in store/trunk/cpp: tests/jrnl/jtt and 1 other directory.
by rhmessaging-commits@lists.jboss.org
Author: kpvdr
Date: 2008-06-10 10:30:38 -0400 (Tue, 10 Jun 2008)
New Revision: 2146
Modified:
store/trunk/cpp/lib/BdbMessageStore.cpp
store/trunk/cpp/tests/jrnl/jtt/Makefile.am
store/trunk/cpp/tests/jrnl/jtt/_ut_jrnl_instance.cpp
Log:
Added helpful message for DB_VERSION_MISMATCH error when opening bdb database. See BZ448587: "Unable to start rhm on F8". Also solved last test directory issue
Modified: store/trunk/cpp/lib/BdbMessageStore.cpp
===================================================================
--- store/trunk/cpp/lib/BdbMessageStore.cpp 2008-06-10 11:25:32 UTC (rev 2145)
+++ store/trunk/cpp/lib/BdbMessageStore.cpp 2008-06-10 14:30:38 UTC (rev 2146)
@@ -136,6 +136,10 @@
try {
env.open(bdbdir.c_str(), DB_THREAD | DB_CREATE | DB_INIT_TXN | DB_INIT_LOCK | DB_INIT_LOG | DB_INIT_MPOOL | DB_USE_ENVIRON, 0);
} catch (const DbException& e) {
+ if (e.get_errno() == DB_VERSION_MISMATCH)
+ THROW_STORE_EXCEPTION_2("Database environment mismatch: This version of bd4 does not match that which created the store database. "
+ "(If recovery is not important, delete the contents of the store directory. Otherwise, try upgrading the database using "
+ "db_upgrade or using db_recover - but the db4-utils package must also be installed to use these utilities.)", e);
THROW_STORE_EXCEPTION_2("Error opening environment", e);
}
Modified: store/trunk/cpp/tests/jrnl/jtt/Makefile.am
===================================================================
--- store/trunk/cpp/tests/jrnl/jtt/Makefile.am 2008-06-10 11:25:32 UTC (rev 2145)
+++ store/trunk/cpp/tests/jrnl/jtt/Makefile.am 2008-06-10 14:30:38 UTC (rev 2146)
@@ -31,6 +31,7 @@
TESTS_ENVIRONMENT = \
VALGRIND=$(VALGRIND) \
abs_srcdir=$(abs_srcdir) \
+ TMPDIR=$(TMPDIR) \
$(srcdir)/../../run_test
all-local: .valgrindrc .valgrind.supp
Modified: store/trunk/cpp/tests/jrnl/jtt/_ut_jrnl_instance.cpp
===================================================================
--- store/trunk/cpp/tests/jrnl/jtt/_ut_jrnl_instance.cpp 2008-06-10 11:25:32 UTC (rev 2145)
+++ store/trunk/cpp/tests/jrnl/jtt/_ut_jrnl_instance.cpp 2008-06-10 14:30:38 UTC (rev 2146)
@@ -38,7 +38,7 @@
const string test_filename("_ut_jrnl_instance");
const char* tdp = getenv("TMPDIR");
-const string test_dir(tdp && strlen(tdp) > 0 ? tdp : "/tmp/OrderingTest");
+const string test_dir(tdp && strlen(tdp) > 0 ? tdp : "/tmp/JttTest");
QPID_AUTO_TEST_CASE(constructor_1)
{
16 years, 6 months
rhmessaging commits: r2145 - store/trunk/cpp/lib.
by rhmessaging-commits@lists.jboss.org
Author: gordonsim
Date: 2008-06-10 07:25:32 -0400 (Tue, 10 Jun 2008)
New Revision: 2145
Modified:
store/trunk/cpp/lib/BdbMessageStore.cpp
store/trunk/cpp/lib/TxnCtxt.h
Log:
Fixes to construction of tid for use in journal:
* increment of count was unsafe due to per-instance lock; use pointer value instead as this is unique for the lifetime of the TxnCtxt object
* construction of string by adding an int value is not safe; use string stream instead
(These are believed to be fixes to BZ450280)
Modified: store/trunk/cpp/lib/BdbMessageStore.cpp
===================================================================
--- store/trunk/cpp/lib/BdbMessageStore.cpp 2008-06-06 19:03:42 UTC (rev 2144)
+++ store/trunk/cpp/lib/BdbMessageStore.cpp 2008-06-10 11:25:32 UTC (rev 2145)
@@ -54,7 +54,6 @@
bool BdbMessageStore::useAsync;
qpid::sys::Duration BdbMessageStore::defJournalGetEventsTimeout(10 * qpid::sys::TIME_MSEC); // 10ms
qpid::sys::Duration BdbMessageStore::defJournalFlushTimeout(500 * qpid::sys::TIME_MSEC); // 0.5s
-unsigned int TxnCtxt::count = 0;
qpid::sys::Mutex TxnCtxt::globalSerialiser;
BdbMessageStore::BdbMessageStore(const char* envpath) : env(0),
Modified: store/trunk/cpp/lib/TxnCtxt.h
===================================================================
--- store/trunk/cpp/lib/TxnCtxt.h 2008-06-06 19:03:42 UTC (rev 2144)
+++ store/trunk/cpp/lib/TxnCtxt.h 2008-06-10 11:25:32 UTC (rev 2145)
@@ -28,6 +28,7 @@
#include <qpid/broker/MessageStore.h>
#include <qpid/sys/Mutex.h>
#include <boost/shared_ptr.hpp>
+#include <sstream>
#include <memory>
#include <vector>
#include "JournalImpl.h"
@@ -53,15 +54,10 @@
static qpid::sys::Mutex globalSerialiser;
ipqdef impactedQueues; // list of Queues used in the txn
- static unsigned int count;
mutable qpid::sys::Mutex Lock;
IdSequence* loggedtx;
AutoScopedLock globalHolder;
-
- unsigned int getCount() {
- qpid::sys::Mutex::ScopedLock locker(Lock);
- return ++count;
- }
+
/**
* local txn id, if non XA.
*/
@@ -97,7 +93,11 @@
public:
TxnCtxt(IdSequence* _loggedtx=NULL) : loggedtx(_loggedtx), txn(0) {
- if (loggedtx){ tid.assign( "rhm-tid"); tid+=getCount(); }
+ if (loggedtx){
+ std::stringstream s;
+ s << "rhm-tid" << this;
+ tid.assign(s.str());
+ }
}
/**
@@ -137,8 +137,20 @@
env.txn_begin(0, &txn, 0);
if (sync) globalHolder = AutoScopedLock(new qpid::sys::Mutex::ScopedLock(globalSerialiser));
}
- void commit(){ txn->commit(0); completeTXN(true); txn = 0; globalHolder.reset(); }
- void abort(){ txn->abort(); completeTXN(false); txn = 0; globalHolder.reset(); }
+ void commit(){
+ txn->commit(0);
+ txn = 0;
+ completeTXN(true);
+ globalHolder.reset();
+ }
+ void abort(){
+ if (txn) {
+ txn->abort();
+ txn = 0;
+ completeTXN(false);
+ globalHolder.reset();
+ }
+ }
DbTxn* get(){ return txn; }
virtual bool isTPC() { return false; }
virtual const std::string& getXid() { return tid; }
16 years, 6 months
rhmessaging commits: r2144 - store/trunk/cpp/lib.
by rhmessaging-commits@lists.jboss.org
Author: kpvdr
Date: 2008-06-06 15:03:42 -0400 (Fri, 06 Jun 2008)
New Revision: 2144
Modified:
store/trunk/cpp/lib/TxnCtxt.h
Log:
Fix for BZ "450339: [journal] commit and abort rids out-of-order in journal". Added missing external_rid flag to data token before commit/abort operation.
Modified: store/trunk/cpp/lib/TxnCtxt.h
===================================================================
--- store/trunk/cpp/lib/TxnCtxt.h 2008-06-06 15:52:24 UTC (rev 2143)
+++ store/trunk/cpp/lib/TxnCtxt.h 2008-06-06 19:03:42 UTC (rev 2144)
@@ -74,6 +74,7 @@
if (jc && loggedtx) { /* if using journal */
boost::intrusive_ptr<DataTokenImpl> dtokp(new DataTokenImpl);
dtokp->addRef();
+ dtokp->set_external_rid(true);
dtokp->set_rid(loggedtx->next());
try{
if (commit)
16 years, 7 months
rhmessaging commits: r2143 - mgmt/mint/python/mint.
by rhmessaging-commits@lists.jboss.org
Author: nunofsantos
Date: 2008-06-06 11:52:24 -0400 (Fri, 06 Jun 2008)
New Revision: 2143
Modified:
mgmt/mint/python/mint/__init__.py
Log:
remove extraneous import
Modified: mgmt/mint/python/mint/__init__.py
===================================================================
--- mgmt/mint/python/mint/__init__.py 2008-06-06 15:47:31 UTC (rev 2142)
+++ mgmt/mint/python/mint/__init__.py 2008-06-06 15:52:24 UTC (rev 2143)
@@ -7,8 +7,6 @@
from sqlobject import *
from threading import Lock
from traceback import print_exc
-from sys import exc_info
-
from mint import schema
log = logging.getLogger("mint")
16 years, 7 months