git.iko.soy/distributed-process
on master help sign in
Merge pull request #170 from tweag/cqueue-fix

Prevent message loss due to timeouts in CQueue. Thanks Facundo Domínguez!

commit58ef3bfc033a774cf76e832c64d12224d3661c97 authorTim Watson <watson.timothy@gmail.com> dateSat 17 Jan 2015, 10:07 (12 years ago) parentacf1f763e44157
1 file changed+2−2
src/Control/Distributed/Process/Internal/CQueue.hs+2−2
src/Control/Distributed/Process/Internal/CQueue.hs+2−2
@@ -101,7 +101,7 @@ dequeue :: forall m a.
101101 -> BlockSpec -- ^ Blocking behaviour
102102 -> [MatchOn m a] -- ^ List of matches
103103 -> IO (Maybe a) -- ^ 'Nothing' only on timeout
104−dequeue (CQueue arrived incoming) blockSpec matchons =
104+dequeue (CQueue arrived incoming) blockSpec matchons = mask_ $
105105 case blockSpec of
106106 Timeout n -> timeout n $ fmap fromJust run
107107 _other ->
@@ -115,7 +115,7 @@ dequeue (CQueue arrived incoming) blockSpec matchons =
115115 where
116116 chunks = chunkMatches matchons
117117
118− run = mask_ $ do
118+ run = do
119119 arr <- takeMVar arrived
120120 let grabNew xs = do
121121 r <- atomically $ tryReadTChan incoming