mirror of https://github.com/voidlizard/hbs2
wip, hunting busyloops
This commit is contained in:
parent
a85a95d1f2
commit
cc001b0451
|
@ -1319,6 +1319,11 @@ runPeer opts = respawnOnError opts $ do
|
|||
setProbe rpcmsg rpcProbe
|
||||
addProbe rpcProbe
|
||||
|
||||
let doCleanupByPassMessaging = withPeerM penv do
|
||||
debug $ red "doCleanupByPassMessaging"
|
||||
pips <- getKnownPeers @L4Proto
|
||||
cleanupByPassMessaging byPass pips
|
||||
|
||||
let rpcctx = RPC2Context { rpcSelf = myself
|
||||
, rpcConfig = fromPeerConfig conf
|
||||
, rpcMessaging = rpcmsg
|
||||
|
@ -1331,6 +1336,7 @@ runPeer opts = respawnOnError opts $ do
|
|||
, rpcByPassInfo = liftIO (getStat byPass)
|
||||
, rpcProbes = probes
|
||||
, rpcDoFetch = liftIO . fetchHash penv
|
||||
, rpcCleanupByPassMessaging = doCleanupByPassMessaging
|
||||
, rpcDoRefChanHeadPost = refChanHeadPostAction
|
||||
, rpcDoRefChanPropose = refChanProposeAction
|
||||
, rpcDoRefChanNotify = refChanNotifyAction
|
||||
|
|
|
@ -218,6 +218,9 @@ instance (e ~ L4Proto, MonadUnliftIO m, HasRpcContext PeerAPI RPC2Context m) =>
|
|||
_ -> do
|
||||
pure nil
|
||||
|
||||
entry $ bindMatch "test:cleanupByPassMessaging" $ const $ do
|
||||
liftIO rpcCleanupByPassMessaging
|
||||
pure $ mkSym "done"
|
||||
|
||||
entry $ bindMatch "test:explode" $ const do
|
||||
|
||||
|
|
|
@ -32,23 +32,24 @@ import HBS2.Prelude (asyncLinked)
|
|||
|
||||
data RPC2Context =
|
||||
RPC2Context
|
||||
{ rpcSelf :: ThreadId
|
||||
, rpcConfig :: [Syntax C]
|
||||
, rpcMessaging :: MessagingUnix
|
||||
, rpcTCP :: Maybe MessagingTCP
|
||||
, rpcPokeAnswer :: String
|
||||
, rpcPeerEnv :: PeerEnv L4Proto
|
||||
, rpcLocalMultiCast :: Peer L4Proto
|
||||
, rpcStorage :: AnyStorage
|
||||
, rpcBrains :: SomeBrains L4Proto
|
||||
, rpcByPassInfo :: IO ByPassStat
|
||||
, rpcProbes :: TVar [AnyProbe]
|
||||
, rpcDoFetch :: HashRef -> IO ()
|
||||
, rpcDoRefChanHeadPost :: HashRef -> IO ()
|
||||
, rpcDoRefChanPropose :: (PubKey 'Sign 'HBS2Basic, SignedBox ByteString 'HBS2Basic) -> IO ()
|
||||
, rpcDoRefChanNotify :: (PubKey 'Sign 'HBS2Basic, SignedBox ByteString 'HBS2Basic) -> IO ()
|
||||
, rpcMailboxService :: AnyMailboxService HBS2Basic
|
||||
, rpcMailboxAdapter :: AnyMailboxAdapter HBS2Basic
|
||||
{ rpcSelf :: ThreadId
|
||||
, rpcConfig :: [Syntax C]
|
||||
, rpcMessaging :: MessagingUnix
|
||||
, rpcTCP :: Maybe MessagingTCP
|
||||
, rpcPokeAnswer :: String
|
||||
, rpcPeerEnv :: PeerEnv L4Proto
|
||||
, rpcLocalMultiCast :: Peer L4Proto
|
||||
, rpcStorage :: AnyStorage
|
||||
, rpcBrains :: SomeBrains L4Proto
|
||||
, rpcByPassInfo :: IO ByPassStat
|
||||
, rpcProbes :: TVar [AnyProbe]
|
||||
, rpcCleanupByPassMessaging :: IO ()
|
||||
, rpcDoFetch :: HashRef -> IO ()
|
||||
, rpcDoRefChanHeadPost :: HashRef -> IO ()
|
||||
, rpcDoRefChanPropose :: (PubKey 'Sign 'HBS2Basic, SignedBox ByteString 'HBS2Basic) -> IO ()
|
||||
, rpcDoRefChanNotify :: (PubKey 'Sign 'HBS2Basic, SignedBox ByteString 'HBS2Basic) -> IO ()
|
||||
, rpcMailboxService :: AnyMailboxService HBS2Basic
|
||||
, rpcMailboxAdapter :: AnyMailboxAdapter HBS2Basic
|
||||
}
|
||||
|
||||
instance (Monad m, Messaging MessagingUnix UNIX (Encoded UNIX)) => HasFabriq UNIX (ReaderT RPC2Context m) where
|
||||
|
|
Loading…
Reference in New Issue