summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPavel Moravec <pmoravec@apache.org>2014-02-02 14:01:16 +0000
committerPavel Moravec <pmoravec@apache.org>2014-02-02 14:01:16 +0000
commit0ab80c9e7799a1935aad8777d92c166f661993ec (patch)
tree11503546d4f2f3122fd3cdaf490eaae0b3d56c76
parent6823d23dbeca328f4e860538a52015bc9313a6db (diff)
downloadqpid-python-0ab80c9e7799a1935aad8777d92c166f661993ec.tar.gz
QPID-5121: Store module does not raise exception when attempting to enqueue a message bigger than the journal size
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1563613 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--qpid/cpp/src/qpid/legacystore/jrnl/wrfc.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/qpid/cpp/src/qpid/legacystore/jrnl/wrfc.cpp b/qpid/cpp/src/qpid/legacystore/jrnl/wrfc.cpp
index 43461b66a3..64ee65f1ac 100644
--- a/qpid/cpp/src/qpid/legacystore/jrnl/wrfc.cpp
+++ b/qpid/cpp/src/qpid/legacystore/jrnl/wrfc.cpp
@@ -125,7 +125,8 @@ wrfc::enq_threshold(const u_int32_t enq_dsize_dblks) const
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_dsize_dblks) const
{
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()