You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by pm...@apache.org on 2014/11/18 16:01:31 UTC

svn commit: r1640357 - in /qpid/trunk/qpid/cpp/src/qpid/linearstore/journal: EmptyFilePool.cpp jerrno.cpp jerrno.h

Author: pmoravec
Date: Tue Nov 18 15:01:31 2014
New Revision: 1640357

URL: http://svn.apache.org/r1640357
Log:
QPID-6232: [C++ broker] Linearstore segfaults when ulimit prevents creating new file in EFP

Modified:
    qpid/trunk/qpid/cpp/src/qpid/linearstore/journal/EmptyFilePool.cpp
    qpid/trunk/qpid/cpp/src/qpid/linearstore/journal/jerrno.cpp
    qpid/trunk/qpid/cpp/src/qpid/linearstore/journal/jerrno.h

Modified: qpid/trunk/qpid/cpp/src/qpid/linearstore/journal/EmptyFilePool.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/linearstore/journal/EmptyFilePool.cpp?rev=1640357&r1=1640356&r2=1640357&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/linearstore/journal/EmptyFilePool.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/linearstore/journal/EmptyFilePool.cpp Tue Nov 18 15:01:31 2014
@@ -239,7 +239,9 @@ bool EmptyFilePool::overwriteFileContent
         return true;
 //std::cout << "*** WARNING: EFP " << efpDirectory_ << " is empty - created new journal file " << fqFileName.substr(fqFileName.rfind('/') + 1) << " on the fly" << std::endl; // DEBUG
     } else {
-//std::cerr << "*** ERROR: Unable to open file \"" << fqFileName << "\"" << std::endl; // DEBUG
+        std::ostringstream oss;
+        oss << "std::ofstream ofs: file=\"" << fqFileName.c_str() << "\"" << " failed to be open";
+        throw jexception(jerrno::JERR_EFP_FOPEN, oss.str(), "EmptyFilePool", "overwriteFileContents");
     }
     return false;
 }

Modified: qpid/trunk/qpid/cpp/src/qpid/linearstore/journal/jerrno.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/linearstore/journal/jerrno.cpp?rev=1640357&r1=1640356&r2=1640357&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/linearstore/journal/jerrno.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/linearstore/journal/jerrno.cpp Tue Nov 18 15:01:31 2014
@@ -115,6 +115,7 @@ const uint32_t jerrno::JERR_EFP_EMPTY   
 const uint32_t jerrno::JERR_EFP_SYMLINK          = 0x0d06;
 const uint32_t jerrno::JERR_EFP_LSTAT            = 0x0d07;
 const uint32_t jerrno::JERR_EFP_BADFILETYPE      = 0x0d08;
+const uint32_t jerrno::JERR_EFP_FOPEN            = 0x0d09;
 
 // Negative returns for some functions
 const int32_t jerrno::AIO_TIMEOUT                = -1;
@@ -212,6 +213,7 @@ jerrno::__init()
     _err_map[JERR_EFP_SYMLINK] = "JERR_EFP_SYMLINK: Symbolic link operation failed";
     _err_map[JERR_EFP_LSTAT] = "JERR_EFP_LSTAT: lstat() operation failed";
     _err_map[JERR_EFP_BADFILETYPE] = "JERR_EFP_BADFILETYPE: File type incorrect for operation";
+    _err_map[JERR_EFP_FOPEN] = "JERR_EFP_FOPEN: Unable to fopen file for write";
 
     //_err_map[] = "";
 

Modified: qpid/trunk/qpid/cpp/src/qpid/linearstore/journal/jerrno.h
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/linearstore/journal/jerrno.h?rev=1640357&r1=1640356&r2=1640357&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/linearstore/journal/jerrno.h (original)
+++ qpid/trunk/qpid/cpp/src/qpid/linearstore/journal/jerrno.h Tue Nov 18 15:01:31 2014
@@ -133,6 +133,7 @@ namespace journal {
         static const uint32_t JERR_EFP_SYMLINK;         ///< Symbolic Link operation failed
         static const uint32_t JERR_EFP_LSTAT;           ///< lstat operation failed
         static const uint32_t JERR_EFP_BADFILETYPE;     ///< Bad file type
+        static const uint32_t JERR_EFP_FOPEN;           ///< Unable to fopen file for write
 
         // Negative returns for some functions
         static const int32_t AIO_TIMEOUT;               ///< Timeout waiting for AIO return



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