Skip to content

Commit

Permalink
Merge pull request #8220 from dillaman/wip-15202
Browse files Browse the repository at this point in the history
journal: prevent race injecting new records into overflowed object

Reviewed-by: Josh Durgin <jdurgin@redhat.com>
  • Loading branch information
jdurgin committed Mar 19, 2016
2 parents a27f9bf + 9722dee commit 802e6bb
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/journal/ObjectRecorder.cc
Expand Up @@ -47,6 +47,12 @@ bool ObjectRecorder::append(const AppendBuffers &append_buffers) {
bool schedule_append = false;
{
Mutex::Locker locker(m_lock);
if (m_overflowed) {
m_append_buffers.insert(m_append_buffers.end(),
append_buffers.begin(), append_buffers.end());
return false;
}

for (AppendBuffers::const_iterator iter = append_buffers.begin();
iter != append_buffers.end(); ++iter) {
if (append(*iter, &schedule_append)) {
Expand Down

0 comments on commit 802e6bb

Please sign in to comment.