rhmessaging commits: r2079 - mgmt/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2008-05-28 10:06:46 -0400 (Wed, 28 May 2008)
New Revision: 2079
Modified:
mgmt/cumin/python/cumin/client.py
mgmt/cumin/python/cumin/exchange.py
Log:
Some naming fix ups
Modified: mgmt/cumin/python/cumin/client.py
===================================================================
--- mgmt/cumin/python/cumin/client.py 2008-05-28 14:05:31 UTC (rev 2078)
+++ mgmt/cumin/python/cumin/client.py 2008-05-28 14:06:46 UTC (rev 2079)
@@ -216,8 +216,8 @@
def show_sessions(self, session):
return self.__tabs.show_mode(session, self.__sessions)
- def render_script(self, session, queue):
- data = "model.xml?class=client;id=%i" % queue.id
+ def render_script(self, session, client):
+ data = "model.xml?class=client;id=%i" % client.id
return "wooly.setIntervalUpdate('%s', updateClient, 3000)" % data
class ClientStats(Widget):
Modified: mgmt/cumin/python/cumin/exchange.py
===================================================================
--- mgmt/cumin/python/cumin/exchange.py 2008-05-28 14:05:31 UTC (rev 2078)
+++ mgmt/cumin/python/cumin/exchange.py 2008-05-28 14:06:46 UTC (rev 2079)
@@ -211,8 +211,8 @@
def show_bindings(self, session):
return self.__tabs.show_mode(session, self.__bindings);
- def render_script(self, session, queue):
- data = "model.xml?class=exchange;id=%i" % queue.id
+ def render_script(self, session, exchange):
+ data = "model.xml?class=exchange;id=%i" % exchange.id
return "wooly.setIntervalUpdate('%s', updateExchange, 3000)" % data
class ExchangeBindingSet(BindingSet):
16 years
rhmessaging commits: r2078 - mgmt/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2008-05-28 10:05:31 -0400 (Wed, 28 May 2008)
New Revision: 2078
Modified:
mgmt/cumin/python/cumin/action.py
Log:
bz446960 - Display a useful error message when a user tries to close a management session
Modified: mgmt/cumin/python/cumin/action.py
===================================================================
--- mgmt/cumin/python/cumin/action.py 2008-05-22 15:53:50 UTC (rev 2077)
+++ mgmt/cumin/python/cumin/action.py 2008-05-28 14:05:31 UTC (rev 2078)
@@ -50,8 +50,7 @@
text = "Completed"
else:
if item.exception:
- text = "Failed: " + \
- item.exception.__class__.__name__
+ text = "Failed: " + str(item.exception)
else:
text = "Failed: " + item.status
16 years
rhmessaging commits: r2077 - store/trunk/cpp/lib/gen/qpid/management.
by rhmessaging-commits@lists.jboss.org
Author: tedross
Date: 2008-05-22 11:53:50 -0400 (Thu, 22 May 2008)
New Revision: 2077
Modified:
store/trunk/cpp/lib/gen/qpid/management/Journal.cpp
store/trunk/cpp/lib/gen/qpid/management/Journal.h
store/trunk/cpp/lib/gen/qpid/management/Store.cpp
store/trunk/cpp/lib/gen/qpid/management/Store.h
Log:
Regenerated management files
Modified: store/trunk/cpp/lib/gen/qpid/management/Journal.cpp
===================================================================
--- store/trunk/cpp/lib/gen/qpid/management/Journal.cpp 2008-05-21 15:55:53 UTC (rev 2076)
+++ store/trunk/cpp/lib/gen/qpid/management/Journal.cpp 2008-05-22 15:53:50 UTC (rev 2077)
@@ -377,7 +377,7 @@
void Journal::writeConfig (Buffer& buf)
{
- sys::RWlock::ScopedRlock readLock (accessLock);
+ sys::Mutex::ScopedLock mutex(accessLock);
configChanged = false;
writeTimestamps (buf);
@@ -393,7 +393,7 @@
void Journal::writeInstrumentation (Buffer& buf, bool skipHeaders)
{
- sys::RWlock::ScopedWlock writeLock (accessLock);
+ sys::Mutex::ScopedLock mutex(accessLock);
instChanged = false;
if (!skipHeaders)
Modified: store/trunk/cpp/lib/gen/qpid/management/Journal.h
===================================================================
--- store/trunk/cpp/lib/gen/qpid/management/Journal.h 2008-05-21 15:55:53 UTC (rev 2076)
+++ store/trunk/cpp/lib/gen/qpid/management/Journal.h 2008-05-22 15:53:50 UTC (rev 2077)
@@ -105,71 +105,69 @@
// Accessor Methods
inline void set_name (std::string val){
- sys::RWlock::ScopedWlock writeLock (accessLock);
+ sys::Mutex::ScopedLock mutex(accessLock);
name = val;
configChanged = true;
}
inline void set_journalDirectory (std::string val){
- sys::RWlock::ScopedWlock writeLock (accessLock);
+ sys::Mutex::ScopedLock mutex(accessLock);
journalDirectory = val;
configChanged = true;
}
inline void set_journalBaseFileName (std::string val){
- sys::RWlock::ScopedWlock writeLock (accessLock);
+ sys::Mutex::ScopedLock mutex(accessLock);
journalBaseFileName = val;
configChanged = true;
}
inline void set_journalWritePageSize (uint32_t val){
- sys::RWlock::ScopedWlock writeLock (accessLock);
+ sys::Mutex::ScopedLock mutex(accessLock);
journalWritePageSize = val;
configChanged = true;
}
inline void set_journalWritePages (uint32_t val){
- sys::RWlock::ScopedWlock writeLock (accessLock);
+ sys::Mutex::ScopedLock mutex(accessLock);
journalWritePages = val;
configChanged = true;
}
inline void set_journalReadPageSize (uint32_t val){
- sys::RWlock::ScopedWlock writeLock (accessLock);
+ sys::Mutex::ScopedLock mutex(accessLock);
journalReadPageSize = val;
configChanged = true;
}
inline void set_journalReadPages (uint32_t val){
- sys::RWlock::ScopedWlock writeLock (accessLock);
+ sys::Mutex::ScopedLock mutex(accessLock);
journalReadPages = val;
configChanged = true;
}
inline void set_initialFileCount (uint16_t val){
- sys::RWlock::ScopedWlock writeLock (accessLock);
+ sys::Mutex::ScopedLock mutex(accessLock);
initialFileCount = val;
instChanged = true;
}
inline void set_dataFileSize (uint32_t val){
- sys::RWlock::ScopedWlock writeLock (accessLock);
+ sys::Mutex::ScopedLock mutex(accessLock);
dataFileSize = val;
instChanged = true;
}
inline void set_journalCurrentFileCount (uint32_t val){
- sys::RWlock::ScopedWlock writeLock (accessLock);
+ sys::Mutex::ScopedLock mutex(accessLock);
journalCurrentFileCount = val;
instChanged = true;
}
inline void inc_journalRecordDepth (uint32_t by = 1){
- sys::RWlock::ScopedWlock writeLock (accessLock);
journalRecordDepth += by;
if (journalRecordDepthHigh < journalRecordDepth)
journalRecordDepthHigh = journalRecordDepth;
instChanged = true;
}
inline void dec_journalRecordDepth (uint32_t by = 1){
- sys::RWlock::ScopedWlock writeLock (accessLock);
journalRecordDepth -= by;
if (journalRecordDepthLow > journalRecordDepth)
journalRecordDepthLow = journalRecordDepth;
instChanged = true;
}
inline void set_journalRecordDepth (uint32_t val){
- sys::RWlock::ScopedWlock writeLock (accessLock);
+ sys::Mutex::ScopedLock mutex(accessLock);
journalRecordDepth = val;
if (journalRecordDepthLow > val)
journalRecordDepthLow = val;
@@ -178,51 +176,45 @@
instChanged = true;
}
inline void inc_journalRecordEnqueues (uint64_t by = 1){
- sys::RWlock::ScopedWlock writeLock (accessLock);
journalRecordEnqueues += by;
instChanged = true;
}
inline void dec_journalRecordEnqueues (uint64_t by = 1){
- sys::RWlock::ScopedWlock writeLock (accessLock);
journalRecordEnqueues -= by;
instChanged = true;
}
inline void set_journalRecordEnqueues (uint64_t val){
- sys::RWlock::ScopedWlock writeLock (accessLock);
+ sys::Mutex::ScopedLock mutex(accessLock);
journalRecordEnqueues = val;
instChanged = true;
}
inline void inc_journalRecordDequeues (uint64_t by = 1){
- sys::RWlock::ScopedWlock writeLock (accessLock);
journalRecordDequeues += by;
instChanged = true;
}
inline void dec_journalRecordDequeues (uint64_t by = 1){
- sys::RWlock::ScopedWlock writeLock (accessLock);
journalRecordDequeues -= by;
instChanged = true;
}
inline void set_journalRecordDequeues (uint64_t val){
- sys::RWlock::ScopedWlock writeLock (accessLock);
+ sys::Mutex::ScopedLock mutex(accessLock);
journalRecordDequeues = val;
instChanged = true;
}
inline void inc_journalOutstandingAIOs (uint32_t by = 1){
- sys::RWlock::ScopedWlock writeLock (accessLock);
journalOutstandingAIOs += by;
if (journalOutstandingAIOsHigh < journalOutstandingAIOs)
journalOutstandingAIOsHigh = journalOutstandingAIOs;
instChanged = true;
}
inline void dec_journalOutstandingAIOs (uint32_t by = 1){
- sys::RWlock::ScopedWlock writeLock (accessLock);
journalOutstandingAIOs -= by;
if (journalOutstandingAIOsLow > journalOutstandingAIOs)
journalOutstandingAIOsLow = journalOutstandingAIOs;
instChanged = true;
}
inline void set_journalOutstandingAIOs (uint32_t val){
- sys::RWlock::ScopedWlock writeLock (accessLock);
+ sys::Mutex::ScopedLock mutex(accessLock);
journalOutstandingAIOs = val;
if (journalOutstandingAIOsLow > val)
journalOutstandingAIOsLow = val;
@@ -231,21 +223,19 @@
instChanged = true;
}
inline void inc_journalFreeFileCount (uint32_t by = 1){
- sys::RWlock::ScopedWlock writeLock (accessLock);
journalFreeFileCount += by;
if (journalFreeFileCountHigh < journalFreeFileCount)
journalFreeFileCountHigh = journalFreeFileCount;
instChanged = true;
}
inline void dec_journalFreeFileCount (uint32_t by = 1){
- sys::RWlock::ScopedWlock writeLock (accessLock);
journalFreeFileCount -= by;
if (journalFreeFileCountLow > journalFreeFileCount)
journalFreeFileCountLow = journalFreeFileCount;
instChanged = true;
}
inline void set_journalFreeFileCount (uint32_t val){
- sys::RWlock::ScopedWlock writeLock (accessLock);
+ sys::Mutex::ScopedLock mutex(accessLock);
journalFreeFileCount = val;
if (journalFreeFileCountLow > val)
journalFreeFileCountLow = val;
@@ -254,21 +244,19 @@
instChanged = true;
}
inline void inc_journalAvailableFileCount (uint32_t by = 1){
- sys::RWlock::ScopedWlock writeLock (accessLock);
journalAvailableFileCount += by;
if (journalAvailableFileCountHigh < journalAvailableFileCount)
journalAvailableFileCountHigh = journalAvailableFileCount;
instChanged = true;
}
inline void dec_journalAvailableFileCount (uint32_t by = 1){
- sys::RWlock::ScopedWlock writeLock (accessLock);
journalAvailableFileCount -= by;
if (journalAvailableFileCountLow > journalAvailableFileCount)
journalAvailableFileCountLow = journalAvailableFileCount;
instChanged = true;
}
inline void set_journalAvailableFileCount (uint32_t val){
- sys::RWlock::ScopedWlock writeLock (accessLock);
+ sys::Mutex::ScopedLock mutex(accessLock);
journalAvailableFileCount = val;
if (journalAvailableFileCountLow > val)
journalAvailableFileCountLow = val;
@@ -277,81 +265,71 @@
instChanged = true;
}
inline void inc_journalWriteWaitFailures (uint64_t by = 1){
- sys::RWlock::ScopedWlock writeLock (accessLock);
journalWriteWaitFailures += by;
instChanged = true;
}
inline void dec_journalWriteWaitFailures (uint64_t by = 1){
- sys::RWlock::ScopedWlock writeLock (accessLock);
journalWriteWaitFailures -= by;
instChanged = true;
}
inline void set_journalWriteWaitFailures (uint64_t val){
- sys::RWlock::ScopedWlock writeLock (accessLock);
+ sys::Mutex::ScopedLock mutex(accessLock);
journalWriteWaitFailures = val;
instChanged = true;
}
inline void inc_journalWriteBusyFailures (uint64_t by = 1){
- sys::RWlock::ScopedWlock writeLock (accessLock);
journalWriteBusyFailures += by;
instChanged = true;
}
inline void dec_journalWriteBusyFailures (uint64_t by = 1){
- sys::RWlock::ScopedWlock writeLock (accessLock);
journalWriteBusyFailures -= by;
instChanged = true;
}
inline void set_journalWriteBusyFailures (uint64_t val){
- sys::RWlock::ScopedWlock writeLock (accessLock);
+ sys::Mutex::ScopedLock mutex(accessLock);
journalWriteBusyFailures = val;
instChanged = true;
}
inline void inc_journalReadRecordCount (uint64_t by = 1){
- sys::RWlock::ScopedWlock writeLock (accessLock);
journalReadRecordCount += by;
instChanged = true;
}
inline void dec_journalReadRecordCount (uint64_t by = 1){
- sys::RWlock::ScopedWlock writeLock (accessLock);
journalReadRecordCount -= by;
instChanged = true;
}
inline void set_journalReadRecordCount (uint64_t val){
- sys::RWlock::ScopedWlock writeLock (accessLock);
+ sys::Mutex::ScopedLock mutex(accessLock);
journalReadRecordCount = val;
instChanged = true;
}
inline void inc_journalReadBusyFailures (uint64_t by = 1){
- sys::RWlock::ScopedWlock writeLock (accessLock);
journalReadBusyFailures += by;
instChanged = true;
}
inline void dec_journalReadBusyFailures (uint64_t by = 1){
- sys::RWlock::ScopedWlock writeLock (accessLock);
journalReadBusyFailures -= by;
instChanged = true;
}
inline void set_journalReadBusyFailures (uint64_t val){
- sys::RWlock::ScopedWlock writeLock (accessLock);
+ sys::Mutex::ScopedLock mutex(accessLock);
journalReadBusyFailures = val;
instChanged = true;
}
inline void inc_journalWritePageCacheDepth (uint32_t by = 1){
- sys::RWlock::ScopedWlock writeLock (accessLock);
journalWritePageCacheDepth += by;
if (journalWritePageCacheDepthHigh < journalWritePageCacheDepth)
journalWritePageCacheDepthHigh = journalWritePageCacheDepth;
instChanged = true;
}
inline void dec_journalWritePageCacheDepth (uint32_t by = 1){
- sys::RWlock::ScopedWlock writeLock (accessLock);
journalWritePageCacheDepth -= by;
if (journalWritePageCacheDepthLow > journalWritePageCacheDepth)
journalWritePageCacheDepthLow = journalWritePageCacheDepth;
instChanged = true;
}
inline void set_journalWritePageCacheDepth (uint32_t val){
- sys::RWlock::ScopedWlock writeLock (accessLock);
+ sys::Mutex::ScopedLock mutex(accessLock);
journalWritePageCacheDepth = val;
if (journalWritePageCacheDepthLow > val)
journalWritePageCacheDepthLow = val;
@@ -360,21 +338,19 @@
instChanged = true;
}
inline void inc_journalReadPageCacheDepth (uint32_t by = 1){
- sys::RWlock::ScopedWlock writeLock (accessLock);
journalReadPageCacheDepth += by;
if (journalReadPageCacheDepthHigh < journalReadPageCacheDepth)
journalReadPageCacheDepthHigh = journalReadPageCacheDepth;
instChanged = true;
}
inline void dec_journalReadPageCacheDepth (uint32_t by = 1){
- sys::RWlock::ScopedWlock writeLock (accessLock);
journalReadPageCacheDepth -= by;
if (journalReadPageCacheDepthLow > journalReadPageCacheDepth)
journalReadPageCacheDepthLow = journalReadPageCacheDepth;
instChanged = true;
}
inline void set_journalReadPageCacheDepth (uint32_t val){
- sys::RWlock::ScopedWlock writeLock (accessLock);
+ sys::Mutex::ScopedLock mutex(accessLock);
journalReadPageCacheDepth = val;
if (journalReadPageCacheDepthLow > val)
journalReadPageCacheDepthLow = val;
Modified: store/trunk/cpp/lib/gen/qpid/management/Store.cpp
===================================================================
--- store/trunk/cpp/lib/gen/qpid/management/Store.cpp 2008-05-21 15:55:53 UTC (rev 2076)
+++ store/trunk/cpp/lib/gen/qpid/management/Store.cpp 2008-05-22 15:53:50 UTC (rev 2077)
@@ -129,7 +129,7 @@
void Store::writeConfig (Buffer& buf)
{
- sys::RWlock::ScopedRlock readLock (accessLock);
+ sys::Mutex::ScopedLock mutex(accessLock);
configChanged = false;
writeTimestamps (buf);
@@ -143,7 +143,7 @@
void Store::writeInstrumentation (Buffer& buf, bool skipHeaders)
{
- sys::RWlock::ScopedWlock writeLock (accessLock);
+ sys::Mutex::ScopedLock mutex(accessLock);
instChanged = false;
if (!skipHeaders)
Modified: store/trunk/cpp/lib/gen/qpid/management/Store.h
===================================================================
--- store/trunk/cpp/lib/gen/qpid/management/Store.h 2008-05-21 15:55:53 UTC (rev 2076)
+++ store/trunk/cpp/lib/gen/qpid/management/Store.h 2008-05-22 15:53:50 UTC (rev 2077)
@@ -77,27 +77,27 @@
// Accessor Methods
inline void set_brokerRef (uint64_t val){
- sys::RWlock::ScopedWlock writeLock (accessLock);
+ sys::Mutex::ScopedLock mutex(accessLock);
brokerRef = val;
configChanged = true;
}
inline void set_location (std::string val){
- sys::RWlock::ScopedWlock writeLock (accessLock);
+ sys::Mutex::ScopedLock mutex(accessLock);
location = val;
configChanged = true;
}
inline void set_async (uint8_t val){
- sys::RWlock::ScopedWlock writeLock (accessLock);
+ sys::Mutex::ScopedLock mutex(accessLock);
async = val;
configChanged = true;
}
inline void set_defaultInitialFileCount (uint16_t val){
- sys::RWlock::ScopedWlock writeLock (accessLock);
+ sys::Mutex::ScopedLock mutex(accessLock);
defaultInitialFileCount = val;
configChanged = true;
}
inline void set_defaultDataFileSize (uint32_t val){
- sys::RWlock::ScopedWlock writeLock (accessLock);
+ sys::Mutex::ScopedLock mutex(accessLock);
defaultDataFileSize = val;
configChanged = true;
}
16 years
rhmessaging commits: r2076 - in mgmt: cumin/python/cumin and 1 other directories.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2008-05-21 11:55:53 -0400 (Wed, 21 May 2008)
New Revision: 2076
Modified:
mgmt/cumin/bin/cumin
mgmt/cumin/python/cumin/__init__.py
mgmt/cumin/python/cumin/model.py
mgmt/mint/python/mint/__init__.py
Log:
Prevent traces from printing to the console
Modified: mgmt/cumin/bin/cumin
===================================================================
--- mgmt/cumin/bin/cumin 2008-05-21 15:12:59 UTC (rev 2075)
+++ mgmt/cumin/bin/cumin 2008-05-21 15:55:53 UTC (rev 2076)
@@ -1,13 +1,16 @@
#!/usr/bin/python
-import sys, os, socket, logging
+import sys, os, socket
+from logging import getLogger
+
from cumin import *
from cumin.util import *
+log = getLogger("cumin")
+
def do_main(config):
app = Cumin(config.home, config.data, config.spec)
- log = logging.getLogger("cumin.config")
if config.debug:
app.enable_debug()
@@ -15,9 +18,7 @@
try:
app.check()
except Exception, e:
- if hasattr(e, "message"):
- print e.message
-
+ log.exception(e)
sys.exit(1)
app.init()
Modified: mgmt/cumin/python/cumin/__init__.py
===================================================================
--- mgmt/cumin/python/cumin/__init__.py 2008-05-21 15:12:59 UTC (rev 2075)
+++ mgmt/cumin/python/cumin/__init__.py 2008-05-21 15:55:53 UTC (rev 2076)
@@ -9,7 +9,6 @@
from mint import *
from time import sleep
from threading import Thread, Event
-from traceback import print_exc
from base64 import decodestring
from crypt import crypt
Modified: mgmt/cumin/python/cumin/model.py
===================================================================
--- mgmt/cumin/python/cumin/model.py 2008-05-21 15:12:59 UTC (rev 2075)
+++ mgmt/cumin/python/cumin/model.py 2008-05-21 15:55:53 UTC (rev 2076)
@@ -4,12 +4,14 @@
from time import mktime
from datetime import datetime, timedelta
from types import *
-from traceback import print_exc
+from logging import getLogger
from util import *
from formats import *
from parameters import *
+log = getLogger("cumin.model")
+
class CuminModel(object):
def __init__(self, app, data_uri, spec_path):
self.app = app
@@ -145,7 +147,7 @@
invoc.status = "failed"
invoc.exception = e
- print_exc();
+ log.exception(e)
finally:
self.cumin_model.invocations.add(invoc)
Modified: mgmt/mint/python/mint/__init__.py
===================================================================
--- mgmt/mint/python/mint/__init__.py 2008-05-21 15:12:59 UTC (rev 2075)
+++ mgmt/mint/python/mint/__init__.py 2008-05-21 15:55:53 UTC (rev 2076)
@@ -60,7 +60,6 @@
log.info("Connection succeeded")
except:
log.info("Connection failed: " + str(conn.exception))
- print_exc()
def getDefaultVhost(self):
if self.broker:
16 years
rhmessaging commits: r2075 - store/trunk/cpp/lib/jrnl.
by rhmessaging-commits@lists.jboss.org
Author: kpvdr
Date: 2008-05-21 11:12:59 -0400 (Wed, 21 May 2008)
New Revision: 2075
Modified:
store/trunk/cpp/lib/jrnl/file_hdr.hpp
store/trunk/cpp/lib/jrnl/jcntl.cpp
store/trunk/cpp/lib/jrnl/jdir.cpp
store/trunk/cpp/lib/jrnl/nlfh.cpp
store/trunk/cpp/lib/jrnl/pmgr.cpp
store/trunk/cpp/lib/jrnl/rmgr.cpp
store/trunk/cpp/lib/jrnl/wmgr.cpp
Log:
Changed all error messages involving std::errno to use the FORMAT_SYSERR macro in jexception to give more helpful error messages.
Modified: store/trunk/cpp/lib/jrnl/file_hdr.hpp
===================================================================
--- store/trunk/cpp/lib/jrnl/file_hdr.hpp 2008-05-20 22:27:45 UTC (rev 2074)
+++ store/trunk/cpp/lib/jrnl/file_hdr.hpp 2008-05-21 15:12:59 UTC (rev 2075)
@@ -177,7 +177,7 @@
if (::clock_gettime(CLOCK_REALTIME, &ts))
{
std::ostringstream oss;
- oss << "errno=" << errno;
+ oss << FORMAT_SYSERR(errno);
throw jexception(jerrno::JERR__RTCLOCK, oss.str(), "file_hdr", "set_time");
}
_ts_sec = ts.tv_sec;
Modified: store/trunk/cpp/lib/jrnl/jcntl.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/jcntl.cpp 2008-05-20 22:27:45 UTC (rev 2074)
+++ store/trunk/cpp/lib/jrnl/jcntl.cpp 2008-05-21 15:12:59 UTC (rev 2075)
@@ -501,7 +501,7 @@
if (::clock_gettime(CLOCK_REALTIME, &ts))
{
std::ostringstream oss;
- oss << "errno=" << errno;
+ oss << FORMAT_SYSERR(errno);
throw jexception(jerrno::JERR__RTCLOCK, oss.str(), "jcntl", "write_infofile");
}
jinf ji(_jid, _jdir.dirname(), _base_filename, _num_jfiles, _jfsize_sblks,
Modified: store/trunk/cpp/lib/jrnl/jdir.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/jdir.cpp 2008-05-20 22:27:45 UTC (rev 2074)
+++ store/trunk/cpp/lib/jrnl/jdir.cpp 2008-05-21 15:12:59 UTC (rev 2075)
@@ -86,7 +86,7 @@
if (::mkdir(dirname.c_str(), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH))
{
std::ostringstream oss;
- oss << "dir=\"" << dirname << "\" errno=" << errno;
+ oss << "dir=\"" << dirname << "\"" << FORMAT_SYSERR(errno);
throw jexception(jerrno::JERR_JDIR_MKDIR, oss.str(), "jdir", "create_dir");
}
}
@@ -124,7 +124,7 @@
return;
}
std::ostringstream oss;
- oss << "dir=\"" << dirname << "\" errno=" << errno;
+ oss << "dir=\"" << dirname << "\"" << FORMAT_SYSERR(errno);
throw jexception(jerrno::JERR_JDIR_OPENDIR, oss.str(), "jdir", "clear_dir");
}
#ifndef RHM_JOWRITE
@@ -153,7 +153,7 @@
{
std::ostringstream oss;
oss << "file=\"" << oldname.str() << "\" dest=\"" <<
- newname.str() << "\" errno=" << errno;
+ newname.str() << "\"" << FORMAT_SYSERR(errno);
throw jexception(jerrno::JERR_JDIR_FMOVE, oss.str(), "jdir", "clear_dir");
}
}
@@ -165,7 +165,7 @@
// if (errno)
// {
// std::ostringstream oss;
-// oss << "dir=\"" << dirname << "\" errno=" << errno;
+// oss << "dir=\"" << dirname << "\"" << FORMAT_SYSERR(errno);
// ::closedir(dir); // Try to close, it makes no sense to trap errors here...
// throw jexception(jerrno::JERR_JDIR_READDIR, oss.str(), "jdir", "clear_dir");
// }
@@ -173,7 +173,7 @@
if (::closedir(dir))
{
std::ostringstream oss;
- oss << "dir=\"" << dirname << "\" errno=" << errno;
+ oss << "dir=\"" << dirname << "\"" << FORMAT_SYSERR(errno);
throw jexception(jerrno::JERR_JDIR_CLOSEDIR, oss.str(), "jdir", "clear_dir");
}
}
@@ -244,7 +244,7 @@
return;
std::ostringstream oss;
- oss << "dir=\"" << dirname << "\" errno=" << errno;
+ oss << "dir=\"" << dirname << "\"" << FORMAT_SYSERR(errno);
throw jexception(jerrno::JERR_JDIR_OPENDIR, oss.str(), "jdir", "delete_dir");
}
else
@@ -258,7 +258,7 @@
if (::stat(full_name.c_str(), &s))
{
std::ostringstream oss;
- oss << "stat: file=\"" << full_name << "\" errno=" << errno;
+ oss << "stat: file=\"" << full_name << "\"" << FORMAT_SYSERR(errno);
throw jexception(jerrno::JERR_JDIR_STAT, oss.str(), "jdir", "delete_dir");
}
// FIXME: This fn does not handle symbolic links correctly and throws up
@@ -268,7 +268,7 @@
if(::unlink(full_name.c_str()))
{
std::ostringstream oss;
- oss << "unlink: file=\"" << entry->d_name << "\" errno=" << errno;
+ oss << "unlink: file=\"" << entry->d_name << "\"" << FORMAT_SYSERR(errno);
throw jexception(jerrno::JERR_JDIR_UNLINK, oss.str(), "jdir", "delete_dir");
}
}
@@ -290,7 +290,7 @@
// if (errno)
// {
// std::ostringstream oss;
-// oss << "dir=\"" << dirname << "\" errno=" << errno;
+// oss << "dir=\"" << dirname << "\"" << FORMAT_SYSERR(errno);
// ::closedir(dir); // Try to close, it makes no sense to trap errors here...
// throw jexception(jerrno::JERR_JDIR_READDIR, oss.str(), "jdir", "delete_dir");
// }
@@ -299,7 +299,7 @@
if (::closedir(dir))
{
std::ostringstream oss;
- oss << "dir=\"" << dirname << "\" errno=" << errno;
+ oss << "dir=\"" << dirname << "\"" << FORMAT_SYSERR(errno);
throw jexception(jerrno::JERR_JDIR_CLOSEDIR, oss.str(), "jdir", "delete_dir");
}
@@ -307,7 +307,7 @@
if (::rmdir(dirname.c_str()))
{
std::ostringstream oss;
- oss << "dir=\"" << dirname << "\" errno=" << errno;
+ oss << "dir=\"" << dirname << "\"" << FORMAT_SYSERR(errno);
throw jexception(jerrno::JERR_JDIR_RMDIR, oss.str(), "jdir", "delete_dir");
}
}
@@ -321,7 +321,7 @@
if (!dir)
{
std::ostringstream oss;
- oss << "dir=\"" << dirname << "\" errno=" << errno;
+ oss << "dir=\"" << dirname << "\"" << FORMAT_SYSERR(errno);
throw jexception(jerrno::JERR_JDIR_OPENDIR, oss.str(), "jdir", "create_bak_dir");
}
struct dirent* entry;
@@ -348,14 +348,14 @@
// if (errno)
// {
// std::ostringstream oss;
-// oss << "dir=\"" << dirname << "\" errno=" << errno;
+// oss << "dir=\"" << dirname << "\"" << FORMAT_SYSERR(errno);
// ::closedir(dir); // Try to close, it makes no sense to trap errors here...
// throw jexception(jerrno::JERR_JDIR_READDIR, oss.str(), "jdir", "clear_dir");
// }
if (::closedir(dir))
{
std::ostringstream oss;
- oss << "dir=\"" << dirname << "\" errno=" << errno;
+ oss << "dir=\"" << dirname << "\"" << FORMAT_SYSERR(errno);
throw jexception(jerrno::JERR_JDIR_CLOSEDIR, oss.str(), "jdir", "create_bak_dir");
}
std::ostringstream dn;
@@ -364,7 +364,7 @@
if (::mkdir(dn.str().c_str(), S_IRWXU | S_IRWXG | S_IROTH))
{
std::ostringstream oss;
- oss << "dir=\"" << dn.str() << "\" errno=" << errno;
+ oss << "dir=\"" << dn.str() << "\"" << FORMAT_SYSERR(errno);
throw jexception(jerrno::JERR_JDIR_MKDIR, oss.str(), "jdir", "create_bak_dir");
}
return std::string(dn.str());
@@ -377,7 +377,7 @@
if (::stat(name, &s))
{
std::ostringstream oss;
- oss << "file=\"" << name << "\" errno=" << errno;
+ oss << "file=\"" << name << "\"" << FORMAT_SYSERR(errno);
throw jexception(jerrno::JERR_JDIR_STAT, oss.str(), "jdir", "is_dir");
}
return S_ISDIR(s.st_mode);
@@ -399,7 +399,7 @@
return false;
// Throw for any other condition
std::ostringstream oss;
- oss << "file=\"" << name << "\" errno=" << errno;
+ oss << "file=\"" << name << "\"" << FORMAT_SYSERR(errno);
throw jexception(jerrno::JERR_JDIR_STAT, oss.str(), "jdir", "is_dir");
}
return true;
Modified: store/trunk/cpp/lib/jrnl/nlfh.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/nlfh.cpp 2008-05-20 22:27:45 UTC (rev 2074)
+++ store/trunk/cpp/lib/jrnl/nlfh.cpp 2008-05-21 15:12:59 UTC (rev 2075)
@@ -296,7 +296,7 @@
if (_rd_fh < 0)
{
std::ostringstream oss;
- oss << "file=\"" << _fname << "\" errno=" << errno;
+ oss << "file=\"" << _fname << "\"" << FORMAT_SYSERR(errno);
throw jexception(jerrno::JERR_NLFH_OPENRD, oss.str(), "nlfh", "open_fh");
}
_wr_fh = ::open(_fname.c_str(), O_WRONLY | O_DIRECT,
@@ -304,7 +304,7 @@
if (_wr_fh < 0)
{
std::ostringstream oss;
- oss << "file=\"" << _fname << "\" errno=" << errno;
+ oss << "file=\"" << _fname << "\"" << FORMAT_SYSERR(errno);
throw jexception(jerrno::JERR_NLFH_OPENWR, oss.str(), "nlfh", "open_fh");
}
}
@@ -356,7 +356,7 @@
{
std::ostringstream oss;
oss << ": posix_memalign() failed: size=" << nullbuffsize << " blk_size=" << sblksize;
- oss << " errno=" << errno;
+ oss << FORMAT_SYSERR(errno);
throw jexception(jerrno::JERR__MALLOC, oss.str(), "nlfh", "clean_file");
}
std::memset(nullbuf, 0, nullbuffsize);
@@ -367,7 +367,7 @@
{
std::free(nullbuf);
std::ostringstream oss;
- oss << ": open() failed:" << "\" errno=" << errno;
+ oss << ": open() failed:" << "\"" << FORMAT_SYSERR(errno);
throw jexception(jerrno::JERR_NLFH_OPENWR, oss.str(), "nlfh", "clean_file");
}
@@ -379,7 +379,7 @@
::close(fh);
std::free(nullbuf);
std::ostringstream oss;
- oss << ": wr_size=" << (this_write_sblks * sblksize) << " errno=" << errno;
+ oss << ": wr_size=" << (this_write_sblks * sblksize) << FORMAT_SYSERR(errno);
throw jexception(jerrno::JERR_NLFH_WRITE, oss.str(), "nlfh", "clean_file");
}
nsblks -= this_write_sblks;
@@ -390,7 +390,7 @@
if (::close(fh))
{
std::ostringstream oss;
- oss << ": errno=" << errno;
+ oss << FORMAT_SYSERR(errno);
throw jexception(jerrno::JERR_NLFH_CLOSE, oss.str(), "nlfh", "clean_file");
}
}
Modified: store/trunk/cpp/lib/jrnl/pmgr.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/pmgr.cpp 2008-05-20 22:27:45 UTC (rev 2074)
+++ store/trunk/cpp/lib/jrnl/pmgr.cpp 2008-05-21 15:12:59 UTC (rev 2075)
@@ -119,7 +119,7 @@
clean();
std::ostringstream oss;
oss << "posix_memalign(): blksize=" << _sblksize << " size=" << cache_pgsize;
- oss << " errno=" << errno;
+ oss << FORMAT_SYSERR(errno);
throw jexception(jerrno::JERR__MALLOC, oss.str(), "pmgr", "initialize");
}
// 2. Allocate array of page pointers
Modified: store/trunk/cpp/lib/jrnl/rmgr.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/rmgr.cpp 2008-05-20 22:27:45 UTC (rev 2074)
+++ store/trunk/cpp/lib/jrnl/rmgr.cpp 2008-05-21 15:12:59 UTC (rev 2075)
@@ -68,7 +68,7 @@
{
std::ostringstream oss;
oss << "posix_memalign(): blksize=" << _sblksize << " size=" << _sblksize;
- oss << " errno=" << errno;
+ oss << FORMAT_SYSERR(errno);
throw jexception(jerrno::JERR__MALLOC, oss.str(), "rmgr", "initialize");
}
_iocbp = new iocb;
Modified: store/trunk/cpp/lib/jrnl/wmgr.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/wmgr.cpp 2008-05-20 22:27:45 UTC (rev 2074)
+++ store/trunk/cpp/lib/jrnl/wmgr.cpp 2008-05-21 15:12:59 UTC (rev 2075)
@@ -922,7 +922,7 @@
wmgr::clean();
std::ostringstream oss;
oss << "posix_memalign(): blksize=" << _sblksize << " size=" << _sblksize;
- oss << " errno=" << errno;
+ oss << FORMAT_SYSERR(errno);
throw jexception(jerrno::JERR__MALLOC, oss.str(), "wmgr", "initialize");
}
_fhdr_ptr_arr = (void**)std::malloc(_num_jfiles * sizeof(void*));
16 years
rhmessaging commits: r2074 - mgmt/mint/python/mint.
by rhmessaging-commits@lists.jboss.org
Author: nunofsantos
Date: 2008-05-20 18:27:45 -0400 (Tue, 20 May 2008)
New Revision: 2074
Modified:
mgmt/mint/python/mint/__init__.py
Log:
heartbeat control callback
Modified: mgmt/mint/python/mint/__init__.py
===================================================================
--- mgmt/mint/python/mint/__init__.py 2008-05-20 21:54:06 UTC (rev 2073)
+++ mgmt/mint/python/mint/__init__.py 2008-05-20 22:27:45 UTC (rev 2074)
@@ -501,6 +501,8 @@
readableType = "CTRL_SCHEMA_LOADED"
elif (type == managementClient.CTRL_USER):
readableType = "CTRL_USER"
+ elif (type == managementClient.CTRL_HEARTBEAT):
+ readableType = "CTRL_HEARTBEAT"
self.log("BrokerId=%s , Type=%s, Data=%s" % (brokerId, readableType, data))
self.log("END CONTROL---------------------------------------------------\n")
return
16 years
rhmessaging commits: r2073 - mgmt/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2008-05-20 17:54:06 -0400 (Tue, 20 May 2008)
New Revision: 2073
Modified:
mgmt/cumin/python/cumin/__init__.py
Log:
Didn't mean to commit this
Modified: mgmt/cumin/python/cumin/__init__.py
===================================================================
--- mgmt/cumin/python/cumin/__init__.py 2008-05-20 21:53:06 UTC (rev 2072)
+++ mgmt/cumin/python/cumin/__init__.py 2008-05-20 21:54:06 UTC (rev 2073)
@@ -100,8 +100,6 @@
elif attempts % 100 == 0:
reg.connect(self.model.data)
- raise Exception("Testing!")
-
self.event.wait(10)
class CuminServer(WebServer):
16 years
rhmessaging commits: r2072 - mgmt/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2008-05-20 17:53:06 -0400 (Tue, 20 May 2008)
New Revision: 2072
Modified:
mgmt/cumin/python/cumin/__init__.py
Log:
Don't log to the console at all unless we're in debug mode; remove a print_exc
Modified: mgmt/cumin/python/cumin/__init__.py
===================================================================
--- mgmt/cumin/python/cumin/__init__.py 2008-05-20 21:10:58 UTC (rev 2071)
+++ mgmt/cumin/python/cumin/__init__.py 2008-05-20 21:53:06 UTC (rev 2072)
@@ -81,8 +81,8 @@
def run(self):
try:
self.do_run()
- except:
- print_exc()
+ except Exception, e:
+ log.exception(e)
def do_run(self):
while True:
@@ -100,6 +100,8 @@
elif attempts % 100 == 0:
reg.connect(self.model.data)
+ raise Exception("Testing!")
+
self.event.wait(10)
class CuminServer(WebServer):
@@ -176,9 +178,10 @@
self.load_args(sys.argv)
root.removeHandler(h)
- h = logging.StreamHandler()
- h.setLevel(self.debug and logging.DEBUG or logging.ERROR)
- root.addHandler(h)
+ if self.debug:
+ h = logging.StreamHandler()
+ h.setLevel(logging.DEBUG)
+ root.addHandler(h)
try:
h = logging.FileHandler(self.log)
16 years
rhmessaging commits: r2071 - store/trunk/cpp/lib.
by rhmessaging-commits@lists.jboss.org
Author: kpvdr
Date: 2008-05-20 17:10:58 -0400 (Tue, 20 May 2008)
New Revision: 2071
Modified:
store/trunk/cpp/lib/BdbMessageStore.cpp
store/trunk/cpp/lib/JournalImpl.cpp
Log:
BZ447581: ""Enqueue capacity threshhold exceeded" logged to terminal" Found several cerr prints lying around in corners where they had been forgotten, this message included among them. Cleaned house, all messages now go through log.
Modified: store/trunk/cpp/lib/BdbMessageStore.cpp
===================================================================
--- store/trunk/cpp/lib/BdbMessageStore.cpp 2008-05-20 19:13:03 UTC (rev 2070)
+++ store/trunk/cpp/lib/BdbMessageStore.cpp 2008-05-20 21:10:58 UTC (rev 2071)
@@ -305,9 +305,9 @@
(*i)->close(0);
}
} catch (const DbException& e) {
- std::cerr << "Error closing databases: " << e.what() << std::endl;
+ QPID_LOG(error, "Error closing databases: " << e.what());
} catch (const std::exception& e) {
- std::cerr << e.what() << std::endl;
+ QPID_LOG(error, e.what());
} catch (...) {}
if (mgmtObject.get() != 0)
Modified: store/trunk/cpp/lib/JournalImpl.cpp
===================================================================
--- store/trunk/cpp/lib/JournalImpl.cpp 2008-05-20 19:13:03 UTC (rev 2070)
+++ store/trunk/cpp/lib/JournalImpl.cpp 2008-05-20 21:10:58 UTC (rev 2071)
@@ -97,7 +97,7 @@
{
if (_init_flag && !_stop_flag){
try { stop(true); }
- catch (const jexception& e) { std::cerr << e << std::endl; }
+ catch (const jexception& e) { log(LOG_ERROR, e.what()); }
}
(dynamic_cast<GetEventsFireEvent*>(getEventsFireEventsPtr.get()))->cancel();
(dynamic_cast<InactivityFireEvent*>(inactivityFireEventPtr.get()))->cancel();
@@ -459,21 +459,21 @@
{
std::ostringstream oss;
oss << "Enqueue capacity threshold exceeded on queue \"" << _jid << "\".";
- std::cerr << oss.str() << std::endl << std::flush;
+ log(LOG_WARN, oss.str());
THROW_STORE_FULL_EXCEPTION(oss.str());
}
case rhm::journal::RHM_IORES_FULL:
{
std::ostringstream oss;
oss << "Journal full on queue \"" << _jid << "\".";
- std::cerr << oss.str() << std::endl << std::flush;
+ log(LOG_CRITICAL, oss.str());
THROW_STORE_FULL_EXCEPTION(oss.str());
}
default:
{
std::ostringstream oss;
oss << "Unexpected I/O response (" << rhm::journal::iores_str(r) << ") on queue " << _jid << "\".";
- std::cerr << oss.str() << std::endl << std::flush;
+ log(LOG_ERROR, oss.str());
THROW_STORE_FULL_EXCEPTION(oss.str());
}
}
16 years
rhmessaging commits: r2070 - store/trunk/cpp/lib/jrnl.
by rhmessaging-commits@lists.jboss.org
Author: kpvdr
Date: 2008-05-20 15:13:03 -0400 (Tue, 20 May 2008)
New Revision: 2070
Modified:
store/trunk/cpp/lib/jrnl/jcntl.cpp
Log:
Fix for BZ444593: "_st_read.increasing_interval_delayed_read test fails intermittently with RHM_IORES_RCINVALID on qpid-test4". On slow and busy disk systems, the wait loop can exhaust its wait count prematurely and throw an RHM_IORES_RCINVALID while the disk is trying to catch up on previous writes and for the initial file header read of the read synchronization to take place. The wait period was increased from 2ms to 5ms and the count from 50 to 500 (based on observations made on some slow disk systems).
Modified: store/trunk/cpp/lib/jrnl/jcntl.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/jcntl.cpp 2008-05-20 16:10:15 UTC (rev 2069)
+++ store/trunk/cpp/lib/jrnl/jcntl.cpp 2008-05-20 19:13:03 UTC (rev 2070)
@@ -312,8 +312,8 @@
return _rmgr.discard(dtokp);
} */
-#define MAX_RCINVALID_CNT 50
-#define RCINVALID_SLEEP_TIME_MS 2
+#define MAX_RCINVALID_CNT 500
+#define RCINVALID_SLEEP_TIME_MS 5
iores
jcntl::read_data_record(void** const datapp, std::size_t& dsize, void** const xidpp, std::size_t& xidsize,
bool& transient, bool& external, data_tok* const dtokp)
16 years