Skip to content

Commit fccd10a

Browse files
committed
Remove unfinished handlePeersListSimple
See #4362.
1 parent dcaad3c commit fccd10a

File tree

1 file changed

+14
-14
lines changed
  • cardano-node/src/Cardano/Node

1 file changed

+14
-14
lines changed

cardano-node/src/Cardano/Node/Run.hs

+14-14
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,8 @@ module Cardano.Node.Run
2020

2121
import Cardano.Prelude hiding (ByteString, STM, atomically, show, take, trace)
2222
import Data.IP (toSockAddr)
23-
import Prelude (String, error, id, show)
23+
import Prelude (String, id, show)
2424

25-
import qualified Control.Concurrent.Async as Async
2625
import Control.Monad.Class.MonadSTM.Strict
2726
import Control.Monad.Trans.Except.Extra (left)
2827
import "contra-tracer" Control.Tracer
@@ -100,7 +99,6 @@ import Cardano.Node.Protocol (mkConsensusProtocol)
10099
import Cardano.Node.Protocol.Types
101100
import Cardano.Node.Queries
102101
import Cardano.Node.TraceConstraints (TraceConstraints)
103-
import Cardano.Tracing.Peer
104102
import Cardano.Tracing.Tracers
105103

106104
{- HLINT ignore "Use fewer imports" -}
@@ -243,17 +241,16 @@ handleNodeWithTracers cmdPc nc p networkMagic runP = do
243241
getStartupInfo nc p fp
244242
>>= mapM_ (traceWith $ startupTracer tracers)
245243

246-
Async.withAsync (handlePeersListSimple (error "Implement Tracer IO [Peer blk]") nodeKernelData)
247-
$ \_peerLoggingThread ->
248-
-- We ignore peer logging thread if it dies, but it will be killed
249-
-- when 'handleSimpleNode' terminates.
250-
handleSimpleNode runP p2pMode tracers nc
251-
(\nk -> do
252-
setNodeKernel nodeKernelData nk
253-
traceWith (nodeStateTracer tracers) NodeKernelOnline)
254-
`finally`
255-
forM_ eLoggingLayer
256-
shutdownLoggingLayer
244+
-- We ignore peer logging thread if it dies, but it will be killed
245+
-- when 'handleSimpleNode' terminates.
246+
handleSimpleNode runP p2pMode tracers nc
247+
(\nk -> do
248+
setNodeKernel nodeKernelData nk
249+
traceWith (nodeStateTracer tracers) NodeKernelOnline)
250+
`finally` do
251+
putStrLn ("MAIN THREAD FAILED" :: String)
252+
forM_ eLoggingLayer
253+
shutdownLoggingLayer
257254

258255
-- | Currently, we trace only 'ShelleyBased'-info which will be asked
259256
-- by 'cardano-tracer' service as a datapoint. It can be extended in the future.
@@ -297,13 +294,16 @@ setupTrace loggingLayer = do
297294
hn0 <- pack <$> getHostName
298295
return $ take 8 $ fst $ breakOn "." hn0
299296

297+
{-
298+
-- TODO: needs to be finished (issue #4362)
300299
handlePeersListSimple
301300
:: Trace IO Text
302301
-> NodeKernelData blk
303302
-> IO ()
304303
handlePeersListSimple tr nodeKern = forever $ do
305304
getCurrentPeers nodeKern >>= tracePeers tr
306305
threadDelay 2000000 -- 2 seconds.
306+
-}
307307

308308
-- | Sets up a simple node, which will run the chain sync protocol and block
309309
-- fetch protocol, and, if core, will also look at the mempool when trying to

0 commit comments

Comments
 (0)