rhmessaging commits: r4337 - mgmt/newdata/cumin/bin.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2010-09-23 15:52:53 -0400 (Thu, 23 Sep 2010)
New Revision: 4337
Modified:
mgmt/newdata/cumin/bin/cumin
Log:
Make the cumin script babysit its children
Modified: mgmt/newdata/cumin/bin/cumin
===================================================================
--- mgmt/newdata/cumin/bin/cumin 2010-09-23 17:18:37 UTC (rev 4336)
+++ mgmt/newdata/cumin/bin/cumin 2010-09-23 19:52:53 UTC (rev 4337)
@@ -6,10 +6,27 @@
trap die EXIT
-cumin-data &
-data="$!"
+function start_data {
+ cumin-data &
+ data="$!"
+}
-cumin-web &
-web="$!"
+function start_web {
+ cumin-web &
+ web="$!"
+}
-wait
+start_data
+start_web
+
+while [ 0 ]; do
+ sleep 30
+
+ if [ ! -d "/proc/$data" ]; then
+ start_data
+ fi
+
+ if [ ! -d "/proc/$web" ]; then
+ start_web
+ fi
+done
14 years, 3 months
rhmessaging commits: r4336 - in mgmt/newdata/cumin/python/cumin: grid and 1 other directory.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2010-09-23 13:18:37 -0400 (Thu, 23 Sep 2010)
New Revision: 4336
Modified:
mgmt/newdata/cumin/python/cumin/grid/negotiator.py
mgmt/newdata/cumin/python/cumin/model.py
Log:
Adding exception and error logging to quotas
Modified: mgmt/newdata/cumin/python/cumin/grid/negotiator.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/grid/negotiator.py 2010-09-23 14:36:07 UTC (rev 4335)
+++ mgmt/newdata/cumin/python/cumin/grid/negotiator.py 2010-09-23 17:18:37 UTC (rev 4336)
@@ -275,6 +275,10 @@
try:
groups = self.split_group_names(groups['Value'])
except Exception, e:
+ if not groups:
+ groups = ""
+ msg = "Unable to parse groups %s %s" % (groups, e.message)
+ log.debug(msg)
groups = []
info = dict()
Modified: mgmt/newdata/cumin/python/cumin/model.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/model.py 2010-09-23 14:36:07 UTC (rev 4335)
+++ mgmt/newdata/cumin/python/cumin/model.py 2010-09-23 17:18:37 UTC (rev 4336)
@@ -1636,6 +1636,8 @@
self.got_data = True
else:
self.error = QmfException(status)
+ msg = "QMF call returned with status of %s" % str(status)
+ log.error(msg)
return completion
def do_wait(self):
@@ -1651,10 +1653,13 @@
session.call_method(self.get_completion(), obj, method_name, args)
except Exception, e:
self.error = e
+ log.exception(e)
results = self.do_wait()
if not results.got_data and not results.error:
results.error = QmfException("Request timed out")
+ msg = "QMF call %s timed out" % method_name
+ log.error(msg)
return results
@@ -1691,6 +1696,7 @@
session.call_method(call.get_completion(), negotiator, "GetRawConfig", (prepend+group,))
except Exception, e:
call.error = e
+ log.exception(e)
return self.do_wait()
14 years, 3 months
rhmessaging commits: r4335 - mgmt/newdata/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2010-09-23 10:36:07 -0400 (Thu, 23 Sep 2010)
New Revision: 4335
Modified:
mgmt/newdata/cumin/python/cumin/database.py
Log:
Replace closed database connections on demand
Modified: mgmt/newdata/cumin/python/cumin/database.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/database.py 2010-09-23 13:49:25 UTC (rev 4334)
+++ mgmt/newdata/cumin/python/cumin/database.py 2010-09-23 14:36:07 UTC (rev 4335)
@@ -20,11 +20,14 @@
#m = re.match(r"^([^:]+)://([^@]+)@([^/]+)/(.+)$", self.uri)
def get_connection(self):
- if not hasattr(self.thread_local, "connection"):
- self.thread_local.connection = psycopg2.connect(self.dsn)
+ conn = getattr(self.thread_local, "connection", None)
- return self.thread_local.connection
+ if not conn or conn.closed:
+ conn = psycopg2.connect(self.dsn)
+ setattr(self.thread_local, "connection", conn)
+ return conn
+
def __repr__(self):
return self.__class__.__name__
14 years, 3 months
rhmessaging commits: r4334 - in mgmt/newdata/wooly/python/wooly: wsgiserver and 1 other directory.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2010-09-23 09:49:25 -0400 (Thu, 23 Sep 2010)
New Revision: 4334
Modified:
mgmt/newdata/wooly/python/wooly/server.py
mgmt/newdata/wooly/python/wooly/wsgiserver/__init__.py
Log:
For bz 63581. Grow and shrink the worker thread pool as needed.
Adjust the socket backfill and initial threads.
Modified: mgmt/newdata/wooly/python/wooly/server.py
===================================================================
--- mgmt/newdata/wooly/python/wooly/server.py 2010-09-22 21:42:13 UTC (rev 4333)
+++ mgmt/newdata/wooly/python/wooly/server.py 2010-09-23 13:49:25 UTC (rev 4334)
@@ -204,8 +204,8 @@
self.wsgi_server = CherryPyWSGIServer \
((self.server.host, self.server.port),
self.server.service_request,
- request_queue_size=40,
- numthreads=20)
+ request_queue_size=32,
+ numthreads=32)
self.wsgi_server.environ["wsgi.version"] = (1, 1)
Modified: mgmt/newdata/wooly/python/wooly/wsgiserver/__init__.py
===================================================================
--- mgmt/newdata/wooly/python/wooly/wsgiserver/__init__.py 2010-09-22 21:42:13 UTC (rev 4333)
+++ mgmt/newdata/wooly/python/wooly/wsgiserver/__init__.py 2010-09-23 13:49:25 UTC (rev 4334)
@@ -1676,6 +1676,13 @@
if self.interrupt:
raise self.interrupt
+ idle = self.requests.idle
+
+ if idle < 16:
+ self.requests.grow(16)
+ elif idle > 32:
+ self.requests.shrink(2)
+
def bind(self, family, type, proto=0):
"""Create (or recreate) the actual socket object."""
self.socket = socket.socket(family, type, proto)
14 years, 3 months
rhmessaging commits: r4333 - mgmt/newdata/cumin/python/cumin/grid.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2010-09-22 17:42:13 -0400 (Wed, 22 Sep 2010)
New Revision: 4333
Modified:
mgmt/newdata/cumin/python/cumin/grid/submission.py
Log:
Edits to the dag submission ad from Pete's research
Modified: mgmt/newdata/cumin/python/cumin/grid/submission.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/grid/submission.py 2010-09-22 20:11:41 UTC (rev 4332)
+++ mgmt/newdata/cumin/python/cumin/grid/submission.py 2010-09-22 21:42:13 UTC (rev 4333)
@@ -677,17 +677,17 @@
ad["RemoveKillSig"] = "SIGUSR1"
ad["OnExitRemove"] = "ExitSignal =?= 11 || " + \
"(ExitCode =!= UNDEFINED && ExitCode >= 0 && ExitCode <= 2)"
+ ad["CopyToSpool"] = "False"
args = list()
args.append("-f")
- args.append("-l .")
args.append("-Debug 3")
+ args.append("-allowversionmismatch")
+ args.append("-usedagdir")
args.append("-Lockfile %s.lock" % dag_file)
- args.append("-AutoRescue 1")
- args.append("-DoRescueFrom 0")
args.append("-Dag %s" % dag_location)
- ad["Arguments"] = " ".join(args)
+ ad["Args"] = " ".join(args)
vars = list()
vars.append("_CONDOR_DAGMAN_LOG=%s.out" % dag_file)
@@ -701,6 +701,7 @@
descriptors = dict()
descriptors["Requirements"] = "com.redhat.grid.Expression"
descriptors["OnExitRemove"] = "com.redhat.grid.Expression"
+ descriptors["CopyToSpool"] = "com.redhat.grid.Expression"
ad["!!descriptors"] = descriptors
14 years, 3 months
rhmessaging commits: r4332 - mgmt/newdata/wooly/python/wooly.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2010-09-22 16:11:41 -0400 (Wed, 22 Sep 2010)
New Revision: 4332
Modified:
mgmt/newdata/wooly/python/wooly/server.py
Log:
Adjust web server configuration for scale
Modified: mgmt/newdata/wooly/python/wooly/server.py
===================================================================
--- mgmt/newdata/wooly/python/wooly/server.py 2010-09-22 18:22:15 UTC (rev 4331)
+++ mgmt/newdata/wooly/python/wooly/server.py 2010-09-22 20:11:41 UTC (rev 4332)
@@ -202,7 +202,11 @@
self.setDaemon(True)
self.wsgi_server = CherryPyWSGIServer \
- ((self.server.host, self.server.port), self.server.service_request)
+ ((self.server.host, self.server.port),
+ self.server.service_request,
+ request_queue_size=40,
+ numthreads=20)
+
self.wsgi_server.environ["wsgi.version"] = (1, 1)
def run(self):
14 years, 3 months
rhmessaging commits: r4331 - mgmt/newdata/cumin/python/cumin/grid.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2010-09-22 14:22:15 -0400 (Wed, 22 Sep 2010)
New Revision: 4331
Modified:
mgmt/newdata/cumin/python/cumin/grid/submission.py
Log:
Set the job universe correctly for vm submissions
Modified: mgmt/newdata/cumin/python/cumin/grid/submission.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/grid/submission.py 2010-09-22 18:16:18 UTC (rev 4330)
+++ mgmt/newdata/cumin/python/cumin/grid/submission.py 2010-09-22 18:22:15 UTC (rev 4331)
@@ -532,6 +532,7 @@
ad["Owner"] = invoc.user.name
ad["Cmd"] = image # This is just an identifier in this context
ad["Iwd"] = "/tmp"
+ ad["JobUniverse"] = 13 # VM
ad["ShouldTransferFiles"] = "NEVER" # try submit without
ad["RequestMemory"] = \
"ceiling(ifThenElse(JobVMMemory =!= undefined," + \
14 years, 3 months
rhmessaging commits: r4330 - store/trunk/cpp/tests/jrnl.
by rhmessaging-commits@lists.jboss.org
Author: kpvdr
Date: 2010-09-22 14:16:18 -0400 (Wed, 22 Sep 2010)
New Revision: 4330
Modified:
store/trunk/cpp/tests/jrnl/_st_helper_fns.hpp
store/trunk/cpp/tests/jrnl/_ut_jinf.cpp
Log:
Added two additional tests for the new broker recovery checks - inconsistent jdat file sizes and inconsistent OWI flags (where possible). Some misc spelling corrections in the comments.
Modified: store/trunk/cpp/tests/jrnl/_st_helper_fns.hpp
===================================================================
--- store/trunk/cpp/tests/jrnl/_st_helper_fns.hpp 2010-09-22 15:40:39 UTC (rev 4329)
+++ store/trunk/cpp/tests/jrnl/_st_helper_fns.hpp 2010-09-22 18:16:18 UTC (rev 4330)
@@ -104,7 +104,7 @@
* General usage pattern:
* 1. Create instance of lfid_pfid_map.
* 2. Call lfid_pfid_map::journal_create() to simulate initial journal creation.
-* 3. (optional) Call lfid_pfid_map::journal_append() one or more times to simulate the addition of journal files.
+* 3. (optional) Call lfid_pfid_map::journal_insert() one or more times to simulate the addition of journal files.
* 4. Call lfid_pfid_map::write_journal() to create dummy journal files (files containing only file headers)
* 5. Create and initialize the jinf object under test
* 6. Call jinf::analyze() to determine the pfid order - and thus also first and last lids
@@ -178,14 +178,16 @@
* 2. By definition, if a journal is not full (num_used_jfiles < num_jfiles), then all owi flags for those files
* that are used must be the same. It is not possible for an overwrite situation to arise if a journal is not
* full.
- * 3. This function acts on map _map only, and does not create any test files. Call journal_create() to do that.
+ * 3. This function acts on map _map only, and does not create any test files. Call write_journal() to do that.
* 4. This function must be called on a clean test object or on one where the previous test data has been
- * cleared by calling journal_destroy(). Running this function moret than once on existing data will
+ * cleared by calling journal_destroy(). Running this function more than once on existing data will
* result in invalid journals which cannot be recovered.
*/
void journal_create(const u_int16_t num_jfiles, // Total number of files
const u_int16_t num_used_jfiles, // Number of used files, rest empty at end
const u_int16_t oldest_lfid = 0, // Fid where owi reverses
+ const u_int16_t bad_lfid = 0, // Fid where owi reverses again (must be > oldest_lifd),
+ // used for testing bad owi detection
const bool first_owi = false) // Value of first owi flag (ie pfid=0)
{
const bool full = num_used_jfiles == num_jfiles;
@@ -198,8 +200,22 @@
if (pfid < num_used_jfiles)
{
_num_used_files = num_used_jfiles;
- if (full && oldest_lfid > 0 && lfid == oldest_lfid)
- owi = ~owi; // Flip owi if all files in use and oldest_lfid > 0
+ /*
+ * Invert the owi flag from its current value (initially given by first_owi param) only if:
+ * 1. The journal is full (ie all files are used)
+ * AND
+ * 2. oldest_lfid param is non-zero (this is default, but lfid 0 being inverted is logically
+ * inconsistent with first_owi parameter being present)
+ * AND
+ * 3. Either:
+ * * current lfid == oldest_lfid (ie we are preparing the oldest lfid)
+ * OR
+ * * current lfid == bad_lfid AND bad_lfid > oldest (ie we are past the oldest and preparing the
+ * bad lfid)
+ */
+ if (owi_invert_flag = full && oldest_lfid > 0 &&
+ (lfid == oldest_lfid || (bad_lfid > oldest_lfid && lfid == bad_lfid)))
+ owi = !owi;
const u_int64_t frid = u_int64_t(random());
init_fhdr(fh, frid, pfid, lfid, owi);
}
@@ -208,27 +224,28 @@
}
/*
- * Method journal_append(): Used to simulate the insertion of journal files into an existing journal.
+ * Method journal_insert(): Used to simulate the insertion of journal files into an existing journal.
*
* after_lfid: The logical file id (lfid) after which the new file is to be inserted.
* num_files: The number of files to be inserted.
* adjust_lids: Flag indicating that the lids of files _following_ the inserted files are to be adjusted upwards
- * by the number of inserted files. Not doing so simulates a recovery immediatly after insertion
+ * by the number of inserted files. Not doing so simulates a recovery immediately after insertion
* but before the following files are overwritten with their new lids. If this is set false, then:
* a) after_lfid MUST be the most recent file (_oldest_lfid-1 ie last lfid before owi changes).
* b) This call must be the last insert call.
*
* NOTES:
- * 1. It is not possible to insert before lfid/pfid 0; thus these are always coincident. This operation is
- * logically equivilent to inserting after the last lfid, which is possible.
- * 2. It is not possible to append to a journal that is not full. Doing so will result in an unrecoverable
+ * 1. It is not possible to insert before lfid/pfid 0; thus these are always coincidental. This operation is
+ * logically equivalent to inserting after the last lfid, which is possible.
+ * 2. It is not possible to insert into a journal that is not full. Doing so will result in an unrecoverable
* journal (one that is logically inconsistent that can never occur in reality).
* 3. If a journal is stopped/interrupted immediately after a file insertion, there could be duplicate lids in
* play at recovery, as the following file lids in their headers are only overwritten when the file is
* eventually written to during normal operation. The owi flags, however, are used to determine which of the
* ambiguous lids are the inserted files.
+ * 4. This function acts on map _map only, and does not create any test files. Call write_journal() to do that.
*/
- void journal_insert(const u_int16_t after_lfid, // Insert files after this lfid
+ void journal_insert(const u_int16_t after_lfid, // Insert files after this lfid
const u_int16_t num_files = 1, // Number of files to insert
const bool adjust_lids = true) // Adjust lids following inserted files
{
@@ -271,6 +288,11 @@
}
}
+ /*
+ * Get the list of pfids in the map in order of lfid. The pfids are appended to the supplied vector. Only
+ * as many headers as are in the map are appended.
+ * NOTE: will clear any contents from supplied vector before appending pfid list.
+ */
void get_pfid_list(vector<u_int16_t>& pfid_list)
{
pfid_list.clear();
@@ -278,6 +300,11 @@
pfid_list.push_back(i->second._pfid);
}
+ /*
+ * Get the list of lfids in the map. The lfids are appended to the supplied vector in the order they appear
+ * in the map (which is not necessarily the natural or sorted order).
+ * NOTE: will clear any contents from supplied vector before appending lfid list.
+ */
void get_lfid_list(vector<u_int16_t>& lfid_list)
{
lfid_list.clear();
@@ -427,7 +454,7 @@
/*
* Method clean_journal_info_file(): This static method deletes only a jinf file without harming any other
- * journal file or its directory. This is used to clear those tests which rely only on the existance of a
+ * journal file or its directory. This is used to clear those tests which rely only on the existence of a
* jinf file.
*/
static void clean_journal_info_file(const string base_filename)
@@ -437,6 +464,14 @@
BOOST_WARN_MESSAGE(::unlink(fn.str().c_str()) == 0, "clean_journal_info_file(): Failed to remove file " << fn.str());
}
+ static string create_journal_filename(const u_int16_t pfid, const string base_filename)
+ {
+ stringstream fn;
+ fn << test_dir << "/" << base_filename << ".";
+ fn << setfill('0') << hex << setw(4) << pfid << "." << JRNL_DATA_EXTENSION;
+ return fn.str();
+ }
+
private:
static void init_fhdr(file_hdr& fh,
const u_int64_t frid,
@@ -527,14 +562,6 @@
of.write(sblk_buffer.data(), JRNL_DBLK_SIZE * JRNL_SBLK_SIZE);
}
}
-
- static string create_journal_filename(const u_int16_t pfid, const string base_filename)
- {
- stringstream fn;
- fn << test_dir << "/" << base_filename << ".";
- fn << setfill('0') << hex << setw(4) << pfid << "." << JRNL_DATA_EXTENSION;
- return fn.str();
- }
};
const string
Modified: store/trunk/cpp/tests/jrnl/_ut_jinf.cpp
===================================================================
--- store/trunk/cpp/tests/jrnl/_ut_jinf.cpp 2010-09-22 15:40:39 UTC (rev 4329)
+++ store/trunk/cpp/tests/jrnl/_ut_jinf.cpp 2010-09-22 18:16:18 UTC (rev 4330)
@@ -273,7 +273,7 @@
lfid_pfid_map m(jid, base_filename);
::srand48(1);
- // As this test relies on repeatable but random sequences, use many ierations for coverage
+ // As this test relies on repeatable but random sequences, use many iterations for coverage
for (int c = 1; c <= 100; c++)
{
for (u_int16_t num_appends = 1; num_appends <= 2*NUM_JFILES; num_appends++)
@@ -306,4 +306,99 @@
cout << "done" << endl;
}
+QPID_AUTO_TEST_CASE(analyze_inconsistent_jdat_file_size_in_journal)
+{
+ string test_name = get_test_name(test_filename, "analyze_inconsistent_jdat_file_size_in_journal");
+ const string jid = test_name + "_jid";
+ const string base_filename = test_name + "_bfn";
+ lfid_pfid_map m(jid, base_filename);
+ ::srand48(1);
+
+ for (u_int16_t pfid = 1; pfid < NUM_JFILES; pfid++)
+ {
+ m.journal_create(NUM_JFILES, NUM_JFILES, 0);
+ m.write_journal(false, 0);
+
+ const std::string filename = m.create_journal_filename(pfid, base_filename);
+ std::ofstream of(filename.c_str(), ofstream::out | ofstream::app);
+ if (!of.good())
+ BOOST_FAIL("Unable to open test journal file \"" << filename << "\" for writing.");
+ std::size_t expand_size = std::size_t(10 * JRNL_DBLK_SIZE * JRNL_SBLK_SIZE * ::drand48());
+ std::vector<char> sblk_buffer(expand_size, 0);
+ of.write(sblk_buffer.data(), expand_size);
+ of.close();
+
+ stringstream fn;
+ fn << test_dir << "/" << base_filename << "." << JRNL_INFO_EXTENSION;
+ jinf ji(fn.str(), false);
+ try
+ {
+ ji.analyze();
+ BOOST_FAIL("Failed to detect irregular journal file size in file \"" << filename << "\"");
+ }
+ catch (const jexception& e) {} // ignore - expected
+
+ m.destroy_journal();
+ }
+ cout << "done" << endl;
+}
+
+QPID_AUTO_TEST_CASE(analyze_owi_in_non_ae_journal)
+{
+ string test_name = get_test_name(test_filename, "analyze_owi_in_non_ae_journal");
+ const string jid = test_name + "_jid";
+ const string base_filename = test_name + "_bfn";
+ lfid_pfid_map m(jid, base_filename);
+ for (u_int16_t oldest_file = 1; oldest_file < NUM_DEFAULT_JFILES-1; oldest_file++)
+ {
+ for (u_int16_t bad_owi_file = oldest_file + 1; bad_owi_file < NUM_DEFAULT_JFILES; bad_owi_file++)
+ {
+ m.journal_create(NUM_DEFAULT_JFILES, NUM_DEFAULT_JFILES, oldest_file, bad_owi_file);
+ m.write_journal(false, 0);
+
+ stringstream fn;
+ fn << test_dir << "/" << base_filename << "." << JRNL_INFO_EXTENSION;
+ jinf ji(fn.str(), false);
+ try
+ {
+ ji.analyze();
+ BOOST_FAIL("Failed to detect irregular OWI flag in non-ae journal file \"" << fn << "\"");
+ }
+ catch (const jexception& e) {} // ignore - expected
+
+ m.destroy_journal();
+ }
+ }
+ cout << "done" << endl;
+}
+
+QPID_AUTO_TEST_CASE(analyze_owi_in_ae_min_size_journal)
+{
+ string test_name = get_test_name(test_filename, "analyze_owi_in_ae_min_size_journal");
+ const string jid = test_name + "_jid";
+ const string base_filename = test_name + "_bfn";
+ lfid_pfid_map m(jid, base_filename);
+ for (u_int16_t oldest_file = 1; oldest_file < NUM_JFILES-1; oldest_file++)
+ {
+ for (u_int16_t bad_owi_file = oldest_file + 1; bad_owi_file < NUM_JFILES; bad_owi_file++)
+ {
+ m.journal_create(NUM_JFILES, NUM_JFILES, oldest_file, bad_owi_file);
+ m.write_journal(true, 16);
+
+ stringstream fn;
+ fn << test_dir << "/" << base_filename << "." << JRNL_INFO_EXTENSION;
+ jinf ji(fn.str(), false);
+ try
+ {
+ ji.analyze();
+ BOOST_FAIL("Failed to detect irregular OWI flag in min-sized ae journal file \"" << fn << "\"");
+ }
+ catch (const jexception& e) {} // ignore - expected
+
+ m.destroy_journal();
+ }
+ }
+ cout << "done" << endl;
+}
+
QPID_AUTO_TEST_SUITE_END()
14 years, 3 months
rhmessaging commits: r4329 - mgmt/newdata/cumin/python/cumin/messaging.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2010-09-22 11:40:39 -0400 (Wed, 22 Sep 2010)
New Revision: 4329
Modified:
mgmt/newdata/cumin/python/cumin/messaging/brokerlink.py
Log:
Fixed BZ 636445. The db connection was being closed instead of the cursor.
Also fixed a few UI nits:
- The Broker Link page listed None as the link name
- After a link was removed, the yellow action area just listed "Remove" instead of "Remove broker link"
- The remove an individual broker link popup didn't display the link name (or actually the link host since there is no link name)
Modified: mgmt/newdata/cumin/python/cumin/messaging/brokerlink.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/messaging/brokerlink.py 2010-09-22 14:42:35 UTC (rev 4328)
+++ mgmt/newdata/cumin/python/cumin/messaging/brokerlink.py 2010-09-22 15:40:39 UTC (rev 4329)
@@ -29,9 +29,24 @@
self.route_add = RouteAdd(app, self)
self.remove = BrokerLinkRemove(app, self)
+ def get_title(self, session):
+ obj = self.object.get(session)
+
+ return "%s '%s'" % (obj._class._title, obj.host)
+
+class BrokerLinkRemoveForm(ObjectFrameTaskForm):
+ def render_content(self, session):
+ obj = self.object.get(session)
+ return obj.host
+
class BrokerLinkRemove(ObjectFrameTask):
+ def __init__(self, app, frame):
+ super(BrokerLinkRemove, self).__init__(app, frame)
+
+ self.form = BrokerLinkRemoveForm(app, self.name, self)
+
def get_title(self, session):
- return "Remove"
+ return "Remove broker link"
def do_exit(self, session):
self.app.main_page.main.messaging.broker.view.show(session)
@@ -64,7 +79,7 @@
class BrokerLinkSelectionRemove(ObjectSelectorTask):
def get_title(self, session):
- return "Remove"
+ return "Remove broker link"
def do_invoke(self, invoc, link):
self.qmf_call(invoc, link, "close")
@@ -351,7 +366,7 @@
try:
obj = cls.get_object(cursor, _id=vhost._brokerRef_id)
finally:
- conn.close()
+ cursor.close()
if username == "anonymous":
mech = "ANONYMOUS"
14 years, 3 months
rhmessaging commits: r4328 - mgmt/newdata/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2010-09-22 10:42:35 -0400 (Wed, 22 Sep 2010)
New Revision: 4328
Modified:
mgmt/newdata/cumin/python/cumin/widgets.py
Log:
For an issue that appeared as a side effect of bz 636445, don't rollback a connection that is already closed
Modified: mgmt/newdata/cumin/python/cumin/widgets.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/widgets.py 2010-09-22 01:22:35 UTC (rev 4327)
+++ mgmt/newdata/cumin/python/cumin/widgets.py 2010-09-22 14:42:35 UTC (rev 4328)
@@ -1346,8 +1346,10 @@
raise
except:
conn = self.app.database.get_connection()
- conn.rollback()
+ if not conn.closed:
+ conn.rollback()
+
raise
def do_process(self, session):
14 years, 3 months