rhmessaging commits: r4487 - store/trunk/cpp/lib/jrnl.
by rhmessaging-commits@lists.jboss.org
Author: kpvdr
Date: 2011-12-16 10:29:51 -0500 (Fri, 16 Dec 2011)
New Revision: 4487
Modified:
store/trunk/cpp/lib/jrnl/wmgr.cpp
Log:
BZ 768407 - fix for not handling EINTR from ::io_getevents()
Modified: store/trunk/cpp/lib/jrnl/wmgr.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/wmgr.cpp 2011-12-08 21:56:42 UTC (rev 4486)
+++ store/trunk/cpp/lib/jrnl/wmgr.cpp 2011-12-16 15:29:51 UTC (rev 4487)
@@ -671,6 +671,8 @@
int ret = 0;
if ((ret = aio::getevents(_ioctx, flush ? _aio_evt_rem : 1, _aio_evt_rem/*_cache_num_pages + _jc->num_jfiles()*/, _aio_event_arr, timeout)) < 0)
{
+ if (ret == -EINTR) // Interrupted by signal
+ return 0;
std::ostringstream oss;
oss << "io_getevents() failed: " << std::strerror(-ret) << " (" << ret << ")";
throw jexception(jerrno::JERR__AIO, oss.str(), "wmgr", "get_events");
13 years
rhmessaging commits: r4486 - in store/trunk/cpp: lib/jrnl and 1 other directories.
by rhmessaging-commits@lists.jboss.org
Author: kpvdr
Date: 2011-12-08 16:56:42 -0500 (Thu, 08 Dec 2011)
New Revision: 4486
Modified:
store/trunk/cpp/lib/JournalImpl.cpp
store/trunk/cpp/lib/JournalImpl.h
store/trunk/cpp/lib/MessageStoreImpl.cpp
store/trunk/cpp/lib/jrnl/time_ns.cpp
store/trunk/cpp/lib/jrnl/time_ns.hpp
store/trunk/cpp/perf/ScopedTimer.hpp
Log:
760112
Modified: store/trunk/cpp/lib/JournalImpl.cpp
===================================================================
--- store/trunk/cpp/lib/JournalImpl.cpp 2011-12-05 16:14:39 UTC (rev 4485)
+++ store/trunk/cpp/lib/JournalImpl.cpp 2011-12-08 21:56:42 UTC (rev 4486)
@@ -70,7 +70,6 @@
_dlen(0),
_dtok(),
_external(false),
- _agent(a),
_mgmtObject(0),
deleteCallback(onDelete)
{
@@ -81,27 +80,8 @@
timer.add(inactivityFireEventPtr);
}
- if (_agent != 0)
- {
- _mgmtObject = new _qmf::Journal
- (_agent, (qpid::management::Manageable*) this);
+ initManagement(a);
- _mgmtObject->set_name(journalId);
- _mgmtObject->set_directory(journalDirectory);
- _mgmtObject->set_baseFileName(journalBaseFilename);
- _mgmtObject->set_readPageSize(JRNL_RMGR_PAGE_SIZE * JRNL_SBLK_SIZE * JRNL_DBLK_SIZE);
- _mgmtObject->set_readPages(JRNL_RMGR_PAGES);
-
- // The following will be set on initialize(), but being properties, these must be set to 0 in the meantime
- _mgmtObject->set_initialFileCount(0);
- _mgmtObject->set_dataFileSize(0);
- _mgmtObject->set_currentFileCount(0);
- _mgmtObject->set_writePageSize(0);
- _mgmtObject->set_writePages(0);
-
- _agent->addObject(_mgmtObject, 0, true);
- }
-
log(LOG_NOTICE, "Created");
std::ostringstream oss;
oss << "Journal directory = \"" << journalDirectory << "\"; Base file name = \"" << journalBaseFilename << "\"";
@@ -128,6 +108,33 @@
}
void
+JournalImpl::initManagement(qpid::management::ManagementAgent* a)
+{
+ _agent = a;
+ if (_agent != 0)
+ {
+ _mgmtObject = new _qmf::Journal
+ (_agent, (qpid::management::Manageable*) this);
+
+ _mgmtObject->set_name(_jid);
+ _mgmtObject->set_directory(_jdir.dirname());
+ _mgmtObject->set_baseFileName(_base_filename);
+ _mgmtObject->set_readPageSize(JRNL_RMGR_PAGE_SIZE * JRNL_SBLK_SIZE * JRNL_DBLK_SIZE);
+ _mgmtObject->set_readPages(JRNL_RMGR_PAGES);
+
+ // The following will be set on initialize(), but being properties, these must be set to 0 in the meantime
+ _mgmtObject->set_initialFileCount(0);
+ _mgmtObject->set_dataFileSize(0);
+ _mgmtObject->set_currentFileCount(0);
+ _mgmtObject->set_writePageSize(0);
+ _mgmtObject->set_writePages(0);
+
+ _agent->addObject(_mgmtObject, 0, true);
+ }
+}
+
+
+void
JournalImpl::initialize(const u_int16_t num_jfiles,
const bool auto_expand,
const u_int16_t ae_max_jfiles,
Modified: store/trunk/cpp/lib/JournalImpl.h
===================================================================
--- store/trunk/cpp/lib/JournalImpl.h 2011-12-05 16:14:39 UTC (rev 4485)
+++ store/trunk/cpp/lib/JournalImpl.h 2011-12-08 21:56:42 UTC (rev 4486)
@@ -115,6 +115,8 @@
virtual ~JournalImpl();
+ void initManagement(qpid::management::ManagementAgent* agent);
+
void initialize(const u_int16_t num_jfiles,
const bool auto_expand,
const u_int16_t ae_max_jfiles,
Modified: store/trunk/cpp/lib/MessageStoreImpl.cpp
===================================================================
--- store/trunk/cpp/lib/MessageStoreImpl.cpp 2011-12-05 16:14:39 UTC (rev 4485)
+++ store/trunk/cpp/lib/MessageStoreImpl.cpp 2011-12-08 21:56:42 UTC (rev 4486)
@@ -238,6 +238,11 @@
mgmtObject->set_tplCurrentFileCount(tplNumJrnlFiles);
agent->addObject(mgmtObject, 0, true);
+
+ // Initialize all existing queues (ie those recovered before management was initialized)
+ for (JournalListMapItr i=journalList.begin(); i!=journalList.end(); i++) {
+ i->second->initManagement(agent);
+ }
}
}
}
Modified: store/trunk/cpp/lib/jrnl/time_ns.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/time_ns.cpp 2011-12-05 16:14:39 UTC (rev 4485)
+++ store/trunk/cpp/lib/jrnl/time_ns.cpp 2011-12-08 21:56:42 UTC (rev 4486)
@@ -4,7 +4,7 @@
* Qpid asynchronous store plugin library
*
* Messaging journal time struct mrg::journal::time_ns, derived from
- * the ::timespec struct and provided with helper functions.
+ * the timespec struct and provided with helper functions.
*
* \author Kim van der Riet
*
Modified: store/trunk/cpp/lib/jrnl/time_ns.hpp
===================================================================
--- store/trunk/cpp/lib/jrnl/time_ns.hpp 2011-12-05 16:14:39 UTC (rev 4485)
+++ store/trunk/cpp/lib/jrnl/time_ns.hpp 2011-12-08 21:56:42 UTC (rev 4486)
@@ -4,7 +4,7 @@
* Qpid asynchronous store plugin library
*
* Messaging journal time struct mrg::journal::time_ns, derived from
- * the ::timespec struct and provided with helper functions.
+ * the timespec struct and provided with helper functions.
*
* \author Kim van der Riet
*
Modified: store/trunk/cpp/perf/ScopedTimer.hpp
===================================================================
--- store/trunk/cpp/perf/ScopedTimer.hpp 2011-12-05 16:14:39 UTC (rev 4485)
+++ store/trunk/cpp/perf/ScopedTimer.hpp 2011-12-08 21:56:42 UTC (rev 4486)
@@ -64,7 +64,7 @@
class ScopedTimer
{
double& _elapsed; ///< Ref to elapsed time, will be written on destruction of ScopedTimer instances
- std::timespec _startTime; ///< Start time, set on construction
+ ::timespec _startTime; ///< Start time, set on construction
/**
* \brief Convert ::timespec to seconds
@@ -74,7 +74,7 @@
* \param ts std::timespec struct containing the time to be converted.
* \return A double which represents the time in parameter ts in seconds.
*/
- static double _s_getDoubleTime(const std::timespec& ts);
+ static double _s_getDoubleTime(const ::timespec& ts);
public:
/**
13 years
rhmessaging commits: r4485 - store/trunk/cpp/lib/jrnl.
by rhmessaging-commits@lists.jboss.org
Author: kpvdr
Date: 2011-12-05 11:14:39 -0500 (Mon, 05 Dec 2011)
New Revision: 4485
Modified:
store/trunk/cpp/lib/jrnl/jcfg.hpp
Log:
BZ 759575: C++: store crashes when creating large store files on 32-bit RHEL
Modified: store/trunk/cpp/lib/jrnl/jcfg.hpp
===================================================================
--- store/trunk/cpp/lib/jrnl/jcfg.hpp 2011-10-31 15:35:13 UTC (rev 4484)
+++ store/trunk/cpp/lib/jrnl/jcfg.hpp 2011-12-05 16:14:39 UTC (rev 4485)
@@ -60,7 +60,7 @@
#define JRNL_DBLK_SIZE 128 ///< Data block size in bytes (CANNOT BE LESS THAN 32!)
#define JRNL_SBLK_SIZE 4 ///< Disk softblock size in multiples of JRNL_DBLK_SIZE
#define JRNL_MIN_FILE_SIZE 128 ///< Min. jrnl file size in sblks (excl. file_hdr)
-#define JRNL_MAX_FILE_SIZE 4194304 ///< Max. jrnl file size in sblks (excl. file_hdr)
+#define JRNL_MAX_FILE_SIZE 4194176 ///< Max. jrnl file size in sblks (excl. file_hdr)
#define JRNL_MIN_NUM_FILES 4 ///< Min. number of journal files
#define JRNL_MAX_NUM_FILES 64 ///< Max. number of journal files
#define JRNL_ENQ_THRESHOLD 80 ///< Percent full when enqueue connection will be closed
13 years