Skip to content

Commit

Permalink
Install a dummy SIGHUP handler for non p2p mode
Browse files Browse the repository at this point in the history
When sending SIGHUP handler, p2p will reload the configuration, while
non-p2p will exit.  Instead of that we install a dummy handler, which
logs that topology reloading for non-p2p is not supported, which
prevents haskell runtime to use the default signal handler (which forces
the process to exit).

Fixes #3872.
  • Loading branch information
coot committed May 24, 2022
1 parent 0f6a20d commit 1ba957c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions cardano-node/src/Cardano/Node/Run.hs
Expand Up @@ -423,6 +423,15 @@ handleSimpleNode runP p2pMode tracers nc onKernel = do
, srnMaybeMempoolCapacityOverride = ncMaybeMempoolCapacityOverride nc
}
DisabledP2PMode -> do
#ifdef UNIX
_ <- Signals.installHandler
Signals.sigHUP
(Signals.Catch $ do
traceWith (startupTracer tracers)
$ NetworkConfigUpdateError "not supported in non-p2p mode"
)
Nothing
#endif
eitherTopology <- TopologyNonP2P.readTopologyFile nc
nt <- either (\err -> panic $ "Cardano.Node.Run.handleSimpleNodeNonP2P.readTopologyFile: " <> err) pure eitherTopology
let (ipProducerAddrs, dnsProducerAddrs) = producerAddressesNonP2P nt
Expand Down

0 comments on commit 1ba957c

Please sign in to comment.