Skip to content

Commit

Permalink
fix(journal): retry read on empty tag
Browse files Browse the repository at this point in the history
  • Loading branch information
symbiont-stevan-andjelkovic committed Feb 17, 2022
1 parent 8680854 commit 8906236
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/journal/src/Journal/Internal/BufferClaim.hs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ commit :: BufferClaim -> Logger -> IO ()
commit (BufferClaim bb) logger = do
let Capacity frameLen = getCapacity bb
logg logger ("commit, frameLen: " ++ show frameLen)
writeFrameType bb 0 Valid
writeFrameLength bb 0 (HeaderLength (int2Int32 frameLen))

abort :: BufferClaim -> IO ()
Expand Down
2 changes: 1 addition & 1 deletion src/journal/src/Journal/MP.hs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ readJournal jour = do
readJournal jour
else readJournal jour -- If len is negative then the writer hasn't
-- finished writing the padding yet.
else if len <= 0
else if len <= 0 || tag == Empty
then readJournal jour
else do
assertMMsg (show len) (len > 0)
Expand Down

0 comments on commit 8906236

Please sign in to comment.