qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmora...@apache.org
Subject svn commit: r1563613 - /qpid/trunk/qpid/cpp/src/qpid/legacystore/jrnl/wrfc.cpp
Date Sun, 02 Feb 2014 14:01:17 GMT
Author: pmoravec
Date: Sun Feb  2 14:01:16 2014
New Revision: 1563613

URL: http://svn.apache.org/r1563613
Log:
QPID-5121: Store module does not raise exception when attempting to enqueue a message bigger
than the journal size

Modified:
    qpid/trunk/qpid/cpp/src/qpid/legacystore/jrnl/wrfc.cpp

Modified: qpid/trunk/qpid/cpp/src/qpid/legacystore/jrnl/wrfc.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/legacystore/jrnl/wrfc.cpp?rev=1563613&r1=1563612&r2=1563613&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/legacystore/jrnl/wrfc.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/legacystore/jrnl/wrfc.cpp Sun Feb  2 14:01:16 2014
@@ -125,7 +125,8 @@ wrfc::enq_threshold(const u_int32_t enq_
     u_int32_t fwd_dblks = subm_dblks + enq_dsize_dblks + _enq_cap_offs_dblks;
     u_int16_t findex = _fc_index;
     fcntl* fcp = _curr_fc;
-    bool in_use = false;
+    bool in_use = false; // at least one file contains an enqueued record
+    bool overwrite = false; // reached the original journal file we started with
     while (fwd_dblks && !(findex != _fc_index && fcp->enqcnt()))
     {
         fwd_dblks -= fwd_dblks > _fsize_dblks ? _fsize_dblks : fwd_dblks;
@@ -133,12 +134,13 @@ wrfc::enq_threshold(const u_int32_t enq_
         {
             if (++findex == _lpmp->num_jfiles())
                 findex = 0;
+	    overwrite |= findex == _fc_index;
             fcp = _lpmp->get_fcntlp(findex);
         }
         in_use |= fcp->enqcnt() > 0;
     }
     // Return true if threshold exceeded
-    return findex != _fc_index && in_use;
+    return (findex != _fc_index && in_use) || overwrite;
 }
 
 bool wrfc::wr_reset()



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


Mime
View raw message