Skip to content

Commit 17a0be1

Browse files
authored
smp server: expire messages in idle message queues (including not opened) (#1403)
* smp server: expire messages in idle message queues (including not opened) * use message expiration interval * simpler * version * remove version
1 parent 3017d14 commit 17a0be1

File tree

9 files changed

+84
-47
lines changed

9 files changed

+84
-47
lines changed

src/Simplex/Messaging/Server.hs

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,6 @@ smpServer started cfg@ServerConfig {transports, transportConfig = tCfg} attachHT
296296
deliverNtfs ns stats (AClient _ Client {clientId, ntfSubscriptions, sndQ, connected}) =
297297
whenM (currentClient readTVarIO) $ do
298298
subs <- readTVarIO ntfSubscriptions
299-
logDebug $ "NOTIFICATIONS: client #" <> tshow clientId <> " is current with " <> tshow (M.size subs) <> " subs"
300299
ntfQs <- M.assocs . M.filterWithKey (\nId _ -> M.member nId subs) <$> readTVarIO ns
301300
tryAny (atomically $ flushSubscribedNtfs ntfQs) >>= \case
302301
Right len -> updateNtfStats len
@@ -321,12 +320,11 @@ smpServer started cfg@ServerConfig {transports, transportConfig = tCfg} attachHT
321320
writeTVar v []
322321
pure $ foldl' (\acc' ntf -> nmsg nId ntf : acc') acc ntfs -- reverses, to order by time
323322
nmsg nId MsgNtf {ntfNonce, ntfEncMeta} = (CorrId "", nId, NMSG ntfNonce ntfEncMeta)
324-
updateNtfStats 0 = logDebug $ "NOTIFICATIONS: no ntfs for client #" <> tshow clientId
323+
updateNtfStats 0 = pure ()
325324
updateNtfStats len = liftIO $ do
326325
atomicModifyIORef'_ (ntfCount stats) (subtract len)
327326
atomicModifyIORef'_ (msgNtfs stats) (+ len)
328327
atomicModifyIORef'_ (msgNtfsB stats) (+ (len `div` 80 + 1)) -- up to 80 NMSG in the batch
329-
logDebug $ "NOTIFICATIONS: delivered to client #" <> tshow clientId <> " " <> tshow len <> " ntfs"
330328

331329
sendPendingEvtsThread :: Server -> M ()
332330
sendPendingEvtsThread s = do
@@ -386,13 +384,13 @@ smpServer started cfg@ServerConfig {transports, transportConfig = tCfg} attachHT
386384
liftIO $ forever $ do
387385
threadDelay' interval
388386
old <- expireBeforeEpoch expCfg
389-
Sum deleted <- withActiveMsgQueues ms $ expireQueueMsgs stats old
387+
now <- systemSeconds <$> getSystemTime
388+
Sum deleted <- withActiveMsgQueues ms $ expireQueueMsgs now ms old
389+
atomicModifyIORef'_ (msgExpired stats) (+ deleted)
390390
logInfo $ "STORE: expireMessagesThread, expired " <> tshow deleted <> " messages"
391391
where
392-
expireQueueMsgs stats old rId q =
393-
runExceptT (deleteExpiredMsgs rId q True old) >>= \case
394-
Right deleted -> Sum deleted <$ atomicModifyIORef'_ (msgExpired stats) (+ deleted)
395-
Left _ -> pure 0
392+
expireQueueMsgs now ms old rId q =
393+
either (const 0) Sum <$> runExceptT (idleDeleteExpiredMsgs now ms rId q old)
396394

397395
expireNtfsThread :: ServerConfig -> M ()
398396
expireNtfsThread ServerConfig {notificationExpiration = expCfg} = do
@@ -1469,7 +1467,7 @@ client
14691467

14701468
expireMessages :: Maybe ExpirationConfig -> ServerStats -> ExceptT ErrorType IO ()
14711469
expireMessages msgExp stats = do
1472-
deleted <- maybe (pure 0) (deleteExpiredMsgs (recipientId qr) q True <=< liftIO . expireBeforeEpoch) msgExp
1470+
deleted <- maybe (pure 0) (deleteExpiredMsgs ms (recipientId qr) q <=< liftIO . expireBeforeEpoch) msgExp
14731471
liftIO $ when (deleted > 0) $ atomicModifyIORef'_ (msgExpired stats) (+ deleted)
14741472

14751473
-- The condition for delivery of the message is:
@@ -1763,9 +1761,8 @@ processServerMessages = do
17631761
exitFailure
17641762
where
17651763
expireQueue = do
1766-
expired'' <- deleteExpiredMsgs rId q False old
1764+
expired'' <- deleteExpiredMsgs ms rId q old
17671765
stored'' <- getQueueSize ms rId q
1768-
liftIO $ logQueueState q
17691766
liftIO $ closeMsgQueue q
17701767
pure (stored'', expired'')
17711768
processValidateQueue :: RecipientId -> JournalQueue -> IO MessageStats
@@ -1823,7 +1820,7 @@ importMessages tty ms f old_ = do
18231820
-- if the first message in queue head is "quota", remove it.
18241821
mergeQuotaMsgs = withMsgQueue ms rId q "mergeQuotaMsgs" $ \mq ->
18251822
tryPeekMsg_ mq >>= \case
1826-
Just MessageQuota {} -> tryDeleteMsg_ mq False
1823+
Just MessageQuota {} -> tryDeleteMsg_ q mq False
18271824
_ -> pure ()
18281825
msgErr :: Show e => String -> e -> String
18291826
msgErr op e = op <> " error (" <> show e <> "): " <> B.unpack (B.take 100 s)

src/Simplex/Messaging/Server/Env/STM.hs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ defaultMessageExpiration :: ExpirationConfig
121121
defaultMessageExpiration =
122122
ExpirationConfig
123123
{ ttl = defMsgExpirationDays * 86400, -- seconds
124-
checkInterval = 43200 -- seconds, 12 hours
124+
checkInterval = 21600 -- seconds, 6 hours
125125
}
126126

127127
defNtfExpirationHours :: Int64
@@ -290,7 +290,8 @@ newEnv config@ServerConfig {smpCredentials, httpCredentials, storeLogFile, msgSt
290290
AMSType SMSMemory -> AMS SMSMemory <$> newMsgStore STMStoreConfig {storePath = storeMsgsFile, quota = msgQueueQuota}
291291
AMSType SMSJournal -> case storeMsgsFile of
292292
Just storePath ->
293-
let cfg = JournalStoreConfig {storePath, quota = msgQueueQuota, pathParts = journalMsgStoreDepth, maxMsgCount = maxJournalMsgCount, maxStateLines = maxJournalStateLines, stateTailSize = defaultStateTailSize}
293+
let idleInterval = maybe maxBound checkInterval messageExpiration
294+
cfg = JournalStoreConfig {storePath, quota = msgQueueQuota, pathParts = journalMsgStoreDepth, maxMsgCount = maxJournalMsgCount, maxStateLines = maxJournalStateLines, stateTailSize = defaultStateTailSize, idleInterval}
294295
in AMS SMSJournal <$> newMsgStore cfg
295296
Nothing -> putStrLn "Error: journal msg store require path in [STORE_LOG], restore_messages" >> exitFailure
296297
ntfStore <- NtfStore <$> TM.emptyIO

src/Simplex/Messaging/Server/Main.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ smpServerCLI_ generateSite serveStaticFiles attachStaticFiles cfgPath logPath =
148148
doesFileExist iniFile >>= \case
149149
True -> readIniFile iniFile >>= either exitError a
150150
_ -> exitError $ "Error: server is not initialized (" <> iniFile <> " does not exist).\nRun `" <> executableName <> " init`."
151-
newJournalMsgStore = newMsgStore JournalStoreConfig {storePath = storeMsgsJournalDir, pathParts = journalMsgStoreDepth, quota = defaultMsgQueueQuota, maxMsgCount = defaultMaxJournalMsgCount, maxStateLines = defaultMaxJournalStateLines, stateTailSize = defaultStateTailSize}
151+
newJournalMsgStore = newMsgStore JournalStoreConfig {storePath = storeMsgsJournalDir, pathParts = journalMsgStoreDepth, quota = defaultMsgQueueQuota, maxMsgCount = defaultMaxJournalMsgCount, maxStateLines = defaultMaxJournalStateLines, stateTailSize = defaultStateTailSize, idleInterval = checkInterval defaultMessageExpiration}
152152
iniFile = combine cfgPath "smp-server.ini"
153153
serverVersion = "SMP server v" <> simplexMQVersion
154154
defaultServerPorts = "5223,443"

src/Simplex/Messaging/Server/MsgStore/Journal.hs

Lines changed: 33 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ import Data.List (intercalate)
5353
import Data.Maybe (catMaybes, fromMaybe)
5454
import qualified Data.Text as T
5555
import Data.Time.Clock (getCurrentTime)
56+
import Data.Time.Clock.System (SystemTime (..), getSystemTime)
5657
import Data.Time.Format.ISO8601 (iso8601Show)
5758
import GHC.IO (catchAny)
5859
import Simplex.Messaging.Agent.Client (getMapLock, withLockMap)
@@ -92,15 +93,19 @@ data JournalStoreConfig = JournalStoreConfig
9293
-- This number should be set bigger than queue quota.
9394
maxMsgCount :: Int,
9495
maxStateLines :: Int,
95-
stateTailSize :: Int
96+
stateTailSize :: Int,
97+
-- time in seconds after which the queue will be closed after message expiration
98+
idleInterval :: Int64
9699
}
97100

98101
data JournalQueue = JournalQueue
99102
{ queueLock :: Lock,
100103
-- To avoid race conditions and errors when restoring queues,
101104
-- Nothing is written to TVar when queue is deleted.
102105
queueRec :: TVar (Maybe QueueRec),
103-
msgQueue_ :: TVar (Maybe JournalMsgQueue)
106+
msgQueue_ :: TVar (Maybe JournalMsgQueue),
107+
-- system time in seconds since epoch
108+
activeAt :: TVar Int64
104109
}
105110

106111
data JMQueue = JMQueue
@@ -221,7 +226,8 @@ instance STMQueueStore JournalMsgStore where
221226
lock <- getMapLock (queueLocks st) $ recipientId qr
222227
q <- newTVar $! Just qr
223228
mq <- newTVar Nothing
224-
pure $ JournalQueue lock q mq
229+
activeAt <- newTVar 0
230+
pure $ JournalQueue lock q mq activeAt
225231
msgQueue_' = msgQueue_
226232

227233
instance MsgStoreClass JournalMsgStore where
@@ -295,11 +301,11 @@ instance MsgStoreClass JournalMsgStore where
295301
(Nothing <$ putStrLn ("Error: path " <> path' <> " is not a directory, skipping"))
296302

297303
logQueueStates :: JournalMsgStore -> IO ()
298-
logQueueStates ms = withActiveMsgQueues ms $ \_ -> logQueueState
304+
logQueueStates ms = withActiveMsgQueues ms $ \_ -> unStoreIO . logQueueState
299305

300-
logQueueState :: JournalQueue -> IO ()
306+
logQueueState :: JournalQueue -> StoreIO ()
301307
logQueueState q =
302-
void $
308+
StoreIO . void $
303309
readTVarIO (msgQueue_ q)
304310
$>>= \mq -> readTVarIO (handles mq)
305311
$>>= (\hs -> (readTVarIO (state mq) >>= appendState (stateHandle hs)) $> Just ())
@@ -326,9 +332,20 @@ instance MsgStoreClass JournalMsgStore where
326332
journalId <- newJournalId random
327333
mkJournalQueue queue (newMsgQueueState journalId) Nothing
328334

329-
openedMsgQueue :: JournalQueue -> StoreIO (Maybe JournalMsgQueue)
330-
openedMsgQueue = StoreIO . readTVarIO . msgQueue_
331-
{-# INLINE openedMsgQueue #-}
335+
withIdleMsgQueue :: Int64 -> JournalMsgStore -> RecipientId -> JournalQueue -> (JournalMsgQueue -> StoreIO a) -> StoreIO (Maybe a)
336+
withIdleMsgQueue now ms@JournalMsgStore {config} rId q action =
337+
StoreIO $ readTVarIO (msgQueue_ q) >>= \case
338+
Nothing ->
339+
Just <$>
340+
E.bracket
341+
(unStoreIO $ getMsgQueue ms rId q)
342+
(\_ -> closeMsgQueue q)
343+
(unStoreIO . action)
344+
Just mq -> do
345+
ts <- readTVarIO $ activeAt q
346+
if now - ts >= idleInterval config
347+
then Just <$> unStoreIO (action mq) `E.finally` closeMsgQueue q
348+
else pure Nothing
332349

333350
deleteQueue :: JournalMsgStore -> RecipientId -> JournalQueue -> IO (Either ErrorType QueueRec)
334351
deleteQueue ms rId q =
@@ -355,7 +372,7 @@ instance MsgStoreClass JournalMsgStore where
355372
writeMsg :: JournalMsgStore -> RecipientId -> JournalQueue -> Bool -> Message -> ExceptT ErrorType IO (Maybe (Message, Bool))
356373
writeMsg ms rId q' logState msg = isolateQueue rId q' "writeMsg" $ do
357374
q <- getMsgQueue ms rId q'
358-
StoreIO $ do
375+
StoreIO $ (`E.finally` updateActiveAt q') $ do
359376
st@MsgQueueState {canWrite, size} <- readTVarIO (state q)
360377
let empty = size == 0
361378
if canWrite || empty
@@ -419,18 +436,21 @@ instance MsgStoreClass JournalMsgStore where
419436
atomically $ writeTVar tipMsg $ Just (Just ml)
420437
pure $ Just msg
421438

422-
tryDeleteMsg_ :: JournalMsgQueue -> Bool -> StoreIO ()
423-
tryDeleteMsg_ q@JournalMsgQueue {tipMsg, handles} logState = StoreIO $
439+
tryDeleteMsg_ :: JournalQueue -> JournalMsgQueue -> Bool -> StoreIO ()
440+
tryDeleteMsg_ q mq@JournalMsgQueue {tipMsg, handles} logState = StoreIO $ (`E.finally` when logState (updateActiveAt q)) $
424441
void $
425442
readTVarIO tipMsg -- if there is no cached tipMsg, do nothing
426443
$>>= (pure . fmap snd)
427444
$>>= \len -> readTVarIO handles
428-
$>>= \hs -> updateReadPos q logState len hs $> Just ()
445+
$>>= \hs -> updateReadPos mq logState len hs $> Just ()
429446

430447
isolateQueue :: RecipientId -> JournalQueue -> String -> StoreIO a -> ExceptT ErrorType IO a
431448
isolateQueue rId JournalQueue {queueLock} op =
432449
tryStore' op rId . withLock' queueLock op . unStoreIO
433450

451+
updateActiveAt :: JournalQueue -> IO ()
452+
updateActiveAt q = atomically . writeTVar (activeAt q) . systemSeconds =<< getSystemTime
453+
434454
tryStore' :: String -> RecipientId -> IO a -> ExceptT ErrorType IO a
435455
tryStore' op rId = tryStore op rId . fmap Right
436456

src/Simplex/Messaging/Server/MsgStore/STM.hs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import Control.Concurrent.STM
2121
import Control.Monad.IO.Class
2222
import Control.Monad.Trans.Except
2323
import Data.Functor (($>))
24+
import Data.Int (Int64)
2425
import Simplex.Messaging.Protocol
2526
import Simplex.Messaging.Server.MsgStore.Types
2627
import Simplex.Messaging.Server.QueueStore
@@ -108,9 +109,10 @@ instance MsgStoreClass STMMsgStore where
108109
writeTVar msgQueue_ $! Just q
109110
pure q
110111

111-
openedMsgQueue :: STMQueue -> STM (Maybe STMMsgQueue)
112-
openedMsgQueue = readTVar . msgQueue_
113-
{-# INLINE openedMsgQueue #-}
112+
-- does not create queue if it does not exist, does not delete it if it does (can't just close in-memory queue)
113+
withIdleMsgQueue :: Int64 -> STMMsgStore -> RecipientId -> STMQueue -> (STMMsgQueue -> STM a) -> STM (Maybe a)
114+
withIdleMsgQueue _ _ _ STMQueue {msgQueue_} action = readTVar msgQueue_ >>= mapM action
115+
{-# INLINE withIdleMsgQueue #-}
114116

115117
deleteQueue :: STMMsgStore -> RecipientId -> STMQueue -> IO (Either ErrorType QueueRec)
116118
deleteQueue ms rId q = fst <$$> deleteQueue' ms rId q
@@ -157,8 +159,8 @@ instance MsgStoreClass STMMsgStore where
157159
tryPeekMsg_ = tryPeekTQueue . msgQueue
158160
{-# INLINE tryPeekMsg_ #-}
159161

160-
tryDeleteMsg_ :: STMMsgQueue -> Bool -> STM ()
161-
tryDeleteMsg_ STMMsgQueue {msgQueue = q, size} _logState =
162+
tryDeleteMsg_ :: STMQueue -> STMMsgQueue -> Bool -> STM ()
163+
tryDeleteMsg_ _ STMMsgQueue {msgQueue = q, size} _logState =
162164
tryReadTQueue q >>= \case
163165
Just _ -> modifyTVar' size (subtract 1)
164166
_ -> pure ()

src/Simplex/Messaging/Server/MsgStore/Types.hs

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import Control.Monad (foldM)
1515
import Control.Monad.Trans.Except
1616
import Data.Int (Int64)
1717
import Data.Kind
18+
import Data.Maybe (fromMaybe)
1819
import qualified Data.Map.Strict as M
1920
import Data.Time.Clock.System (SystemTime (systemSeconds))
2021
import Simplex.Messaging.Protocol
@@ -42,18 +43,19 @@ class Monad (StoreMonad s) => MsgStoreClass s where
4243
activeMsgQueues :: s -> TMap RecipientId (StoreQueue s)
4344
withAllMsgQueues :: Monoid a => Bool -> s -> (RecipientId -> StoreQueue s -> IO a) -> IO a
4445
logQueueStates :: s -> IO ()
45-
logQueueState :: StoreQueue s -> IO ()
46+
logQueueState :: StoreQueue s -> StoreMonad s ()
4647
queueRec' :: StoreQueue s -> TVar (Maybe QueueRec)
4748
getMsgQueue :: s -> RecipientId -> StoreQueue s -> StoreMonad s (MsgQueue s)
48-
openedMsgQueue :: StoreQueue s -> StoreMonad s (Maybe (MsgQueue s))
49+
-- the journal queue will be closed after action if it was initially closed or idle longer than interval in config
50+
withIdleMsgQueue :: Int64 -> s -> RecipientId -> StoreQueue s -> (MsgQueue s -> StoreMonad s a) -> StoreMonad s (Maybe a)
4951
deleteQueue :: s -> RecipientId -> StoreQueue s -> IO (Either ErrorType QueueRec)
5052
deleteQueueSize :: s -> RecipientId -> StoreQueue s -> IO (Either ErrorType (QueueRec, Int))
5153
getQueueMessages_ :: Bool -> MsgQueue s -> StoreMonad s [Message]
5254
writeMsg :: s -> RecipientId -> StoreQueue s -> Bool -> Message -> ExceptT ErrorType IO (Maybe (Message, Bool))
5355
setOverQuota_ :: StoreQueue s -> IO () -- can ONLY be used while restoring messages, not while server running
5456
getQueueSize_ :: MsgQueue s -> StoreMonad s Int
5557
tryPeekMsg_ :: MsgQueue s -> StoreMonad s (Maybe Message)
56-
tryDeleteMsg_ :: MsgQueue s -> Bool -> StoreMonad s ()
58+
tryDeleteMsg_ :: StoreQueue s -> MsgQueue s -> Bool -> StoreMonad s ()
5759
isolateQueue :: RecipientId -> StoreQueue s -> String -> StoreMonad s a -> ExceptT ErrorType IO a
5860

5961
data MSType = MSMemory | MSJournal
@@ -89,7 +91,7 @@ tryDelMsg st rId q msgId' =
8991
tryPeekMsg_ mq >>= \case
9092
msg_@(Just msg)
9193
| messageId msg == msgId' ->
92-
tryDeleteMsg_ mq True >> pure msg_
94+
tryDeleteMsg_ q mq True >> pure msg_
9395
_ -> pure Nothing
9496

9597
-- atomic delete (== read) last and peek next message if available
@@ -98,21 +100,34 @@ tryDelPeekMsg st rId q msgId' =
98100
withMsgQueue st rId q "tryDelPeekMsg" $ \mq ->
99101
tryPeekMsg_ mq >>= \case
100102
msg_@(Just msg)
101-
| messageId msg == msgId' -> (msg_,) <$> (tryDeleteMsg_ mq True >> tryPeekMsg_ mq)
103+
| messageId msg == msgId' -> (msg_,) <$> (tryDeleteMsg_ q mq True >> tryPeekMsg_ mq)
102104
| otherwise -> pure (Nothing, msg_)
103105
_ -> pure (Nothing, Nothing)
104106

105107
withMsgQueue :: MsgStoreClass s => s -> RecipientId -> StoreQueue s -> String -> (MsgQueue s -> StoreMonad s a) -> ExceptT ErrorType IO a
106108
withMsgQueue st rId q op a = isolateQueue rId q op $ getMsgQueue st rId q >>= a
107109
{-# INLINE withMsgQueue #-}
108110

109-
deleteExpiredMsgs :: MsgStoreClass s => RecipientId -> StoreQueue s -> Bool -> Int64 -> ExceptT ErrorType IO Int
110-
deleteExpiredMsgs rId q logState old =
111-
isolateQueue rId q "deleteExpiredMsgs" $ openedMsgQueue q >>= maybe (pure 0) (loop 0)
111+
deleteExpiredMsgs :: MsgStoreClass s => s -> RecipientId -> StoreQueue s -> Int64 -> ExceptT ErrorType IO Int
112+
deleteExpiredMsgs st rId q old =
113+
isolateQueue rId q "deleteExpiredMsgs" $
114+
getMsgQueue st rId q >>= deleteExpireMsgs_ old q
115+
116+
-- closed and idle queues will be closed after expiration
117+
idleDeleteExpiredMsgs :: MsgStoreClass s => Int64 -> s -> RecipientId -> StoreQueue s -> Int64 -> ExceptT ErrorType IO Int
118+
idleDeleteExpiredMsgs now st rId q old =
119+
isolateQueue rId q "idleDeleteExpiredMsgs" $
120+
fromMaybe 0 <$> withIdleMsgQueue now st rId q (deleteExpireMsgs_ old q)
121+
122+
deleteExpireMsgs_ :: MsgStoreClass s => Int64 -> StoreQueue s -> MsgQueue s -> StoreMonad s Int
123+
deleteExpireMsgs_ old q mq = do
124+
n <- loop 0
125+
logQueueState q
126+
pure n
112127
where
113-
loop dc mq =
128+
loop dc =
114129
tryPeekMsg_ mq >>= \case
115130
Just Message {msgTs}
116131
| systemSeconds msgTs < old ->
117-
tryDeleteMsg_ mq logState >> loop (dc + 1) mq
132+
tryDeleteMsg_ q mq False >> loop (dc + 1)
118133
_ -> pure dc

tests/AgentTests/FunctionalAPITests.hs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3076,8 +3076,9 @@ testTwoUsers = withAgentClients2 $ \a b -> do
30763076
("", "", DOWN _ _) <- nGet a
30773077
("", "", DOWN _ _) <- nGet a
30783078
("", "", DOWN _ _) <- nGet a
3079-
("", "", DOWN _ _) <- nGet a
3080-
("", "", UP _ _) <- nGet a
3079+
-- to avoice race condition
3080+
nGet a =##> \case ("", "", DOWN _ _) -> True; ("", "", UP _ _) -> True; _ -> False
3081+
nGet a =##> \case ("", "", UP _ _) -> True; ("", "", DOWN _ _) -> True; _ -> False
30813082
("", "", UP _ _) <- nGet a
30823083
("", "", UP _ _) <- nGet a
30833084
("", "", UP _ _) <- nGet a

tests/CoreTests/MsgStoreTests.hs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@ testJournalStoreCfg =
7777
quota = 3,
7878
maxMsgCount = 4,
7979
maxStateLines = 2,
80-
stateTailSize = 256
80+
stateTailSize = 256,
81+
idleInterval = 21600
8182
}
8283

8384
mkMessage :: MonadIO m => ByteString -> m Message

tests/CoreTests/RetryIntervalTests.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ testRetryIntervalSameMode =
6666

6767
testRetryIntervalSwitchMode :: Spec
6868
testRetryIntervalSwitchMode =
69-
it "should increase elapased time and interval when the mode stays the same" $ do
69+
it "should increase elapased time and interval when the mode switches" $ do
7070
lock <- newEmptyTMVarIO
7171
intervals <- newTVarIO []
7272
reportedIntervals <- newTVarIO []

0 commit comments

Comments
 (0)