From 890623671f5cb46aa3227d169594179092cc25b2 Mon Sep 17 00:00:00 2001 From: Stevan Andjelkovic Date: Thu, 17 Feb 2022 13:45:25 +0100 Subject: [PATCH] fix(journal): retry read on empty tag --- src/journal/src/Journal/Internal/BufferClaim.hs | 1 + src/journal/src/Journal/MP.hs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/journal/src/Journal/Internal/BufferClaim.hs b/src/journal/src/Journal/Internal/BufferClaim.hs index 90f8d35c..1632ed16 100644 --- a/src/journal/src/Journal/Internal/BufferClaim.hs +++ b/src/journal/src/Journal/Internal/BufferClaim.hs @@ -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 () diff --git a/src/journal/src/Journal/MP.hs b/src/journal/src/Journal/MP.hs index 4c93c95f..5b9a3a57 100644 --- a/src/journal/src/Journal/MP.hs +++ b/src/journal/src/Journal/MP.hs @@ -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)