diff --git a/cabal.project b/cabal.project index de6488c42c8..ad812cc0a3a 100644 --- a/cabal.project +++ b/cabal.project @@ -64,3 +64,64 @@ allow-newer: -- IMPORTANT -- Do NOT add more source-repository-package stanzas here unless they are strictly -- temporary! Please read the section in CONTRIBUTING about updating dependencies. +source-repository-package + type: git + location: https://github.com/jasagredo/async + tag: 57b9ef37662b4c978eef7bc6bd255c9a89d7d731 + +source-repository-package + type: git + location: https://github.com/jasagredo/katip + tag: 186a10c0f92d84375ff69db1d9e0a33adda9d2b8 + subdir: + katip + +source-repository-package + type: git + location: https://github.com/jasagredo/wai + tag: eebc207b826f923c50e9d21fe39d8793b5248a58 + subdir: + warp + +source-repository-package + type: git + location: https://github.com/jasagredo/ekg-wai + tag: 7373a7826abfd5093be931c36542e52421012154 + +source-repository-package + type: git + location: https://github.com/IntersectMBO/ouroboros-network + tag: a00bcfef4a8599a60adb5f908ec56249bcd6ac9d + subdir: + ouroboros-network + ouroboros-network-framework + +source-repository-package + type: git + location: https://github.com/IntersectMBO/ouroboros-consensus + tag: b38ca254f73aae13eb50b2ea9eae786e14ae7a01 + subdir: + ouroboros-consensus + ouroboros-consensus-diffusion + +source-repository-package + type: git + location: https://github.com/input-output-hk/iohk-monitoring-framework + tag: 45fef502fd0380425fd7ff83cd0bf6764f063853 + subdir: + iohk-monitoring + plugins/backend-ekg + plugins/backend-aggregation + plugins/backend-monitoring + +source-repository-package + type: git + location: https://github.com/IntersectMBO/Win32-network + tag: e09fd544175b35779204fbeadcd0a37fc4f92220 + +source-repository-package + type: git + location: https://github.com/input-output-hk/io-sim + tag: d037df6436c270cbb40d58d72cad19dac8b79bab + subdir: + io-classes diff --git a/cardano-node/app/cardano-node.hs b/cardano-node/app/cardano-node.hs index c1a938cf552..ed2637de04d 100644 --- a/cardano-node/app/cardano-node.hs +++ b/cardano-node/app/cardano-node.hs @@ -25,10 +25,14 @@ import System.IO (hPutStrLn, stderr) import Paths_cardano_node (version) +import GHC.Conc + main :: IO () main = do Crypto.cryptoInit + myThreadId >>= flip labelThread "main" + toplevelExceptionHandler $ do cmd <- Opt.customExecParser p opts @@ -45,15 +49,15 @@ main = do p = Opt.prefs Opt.showHelpOnEmpty warnIfSet :: PartialNodeConfiguration -> (PartialNodeConfiguration -> Last a) -> String -> String -> IO () - warnIfSet args f name key = - maybe - (pure ()) - (\_ -> hPutStrLn stderr $ "WARNING: Option --" ++ name ++ " was set via CLI flags.\ + warnIfSet args f name key = + maybe + (pure ()) + (\_ -> hPutStrLn stderr $ "WARNING: Option --" ++ name ++ " was set via CLI flags.\ \ This CLI flag will be removed in upcoming node releases.\ - \ Please, set this configuration option in the configuration file instead with key " ++ key ++ ".") + \ Please, set this configuration option in the configuration file instead with key " ++ key ++ ".") $ getLast $ f args - + opts :: Opt.ParserInfo Command opts = Opt.info (fmap RunCmd nodeCLIParser diff --git a/cardano-node/cardano-node.cabal b/cardano-node/cardano-node.cabal index 68ee7ee961e..3dd040906d6 100644 --- a/cardano-node/cardano-node.cabal +++ b/cardano-node/cardano-node.cabal @@ -223,6 +223,7 @@ executable cardano-node main-is: cardano-node.hs ghc-options: -threaded -rtsopts + -debug if arch(arm) ghc-options: "-with-rtsopts=-T -I0 -A16m -N1 --disable-delayed-os-memory-return" diff --git a/cardano-node/src/Cardano/Node/Configuration/Logging.hs b/cardano-node/src/Cardano/Node/Configuration/Logging.hs index caf41dbb8db..74eef52b5eb 100644 --- a/cardano-node/src/Cardano/Node/Configuration/Logging.hs +++ b/cardano-node/src/Cardano/Node/Configuration/Logging.hs @@ -94,6 +94,7 @@ import Cardano.Slotting.Slot (EpochSize (..)) import Cardano.Tracing.Config (TraceOptions (..)) import Cardano.Tracing.OrphanInstances.Common () import Paths_cardano_node (version) +import GHC.Conc (labelThread, myThreadId) -------------------------------- -- Layer @@ -285,7 +286,9 @@ createLoggingLayer ver nodeConfig' p = do pure () startCapturingMetrics _ tr = do - void . Async.async . forever $ do + void . Async.async $ do + myThreadId >>= flip labelThread "Metrics capturing (cardano-node)" + forever $ do readResourceStats >>= maybe (pure ()) (traceResourceStats