Repository navigation
Run the crypto daemon under score::mw::lifecycle::run_application - #475
Open
prabakaranklst wants to merge 1 commit into
Open
prabakaranklst wants to merge 1 commit into
prabakaranklst wants to merge 1 commit into
Conversation
prabakaranklst
requested review from
ChansAlive,
PandaeDo and
masc2023
as code owners
November 24, 2026 04:55
prabakaranklst
requested a deployment
to
workflow-approval
November 24, 2026 04:55 — with
GitHub Actions
Waiting
prabakaranklst
requested a deployment
to
workflow-approval
November 24, 2026 04:55 — with
GitHub Actions
Waiting
prabakaranklst
requested a deployment
to
workflow-approval
November 24, 2026 04:55 — with
GitHub Actions
Waiting
Contributor
License Check Results🚀 The license check job ran with the Bazel command: bazel run --lockfile_mode=error //:license-checkStatus: Click to expand output |
This branch is waiting to be deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The crypto daemon now runs as an S-CORE lifecycle application instead of managing its own process lifecycle.
Until now,
main()installed a SIGINT/SIGTERM handler, polled a global flag every 100 ms, and never reported its state to the Launch Manager.With
score::mw::lifecycle::run_application, the daemon reportskRunningonce its IPC server is listening.If Launch Manager is used, it can then start crypto clients only after the daemon is ready, stop them before the daemon, and restart the daemon if it crashes.
The daemon still runs without a Launch Manager; it then logs that the
kRunningreport failed and keeps running.Changes:
CryptoDaemon(score/crypto/src/daemon/src/crypto_daemon.{hpp,cpp}) derives fromscore::mw::lifecycle::Application.Initialize()parses the config, creates the provider manager, data manager and key management, and starts the control server. Any failure returnsEXIT_FAILURE, sokRunningis never reported.Run()waits on the stop token, which fires on SIGTERM, then stops the server and waits for sessions to close.main()is reduced to therun_application<CryptoDaemon>call. The hand-written signal handling and polling loop are removed.IDaemonComponentFactorycovers the three steps that need the environment: config parsing, provider manager creation and control server creation.DaemonComponentFactoryis the production implementation; unit tests replace it with a mock.bazel_deponscore_lifecycle0.10.1. It pins the samescore_baselibs(0.2.18) andscore_communication(0.6.0) as this repo.score/crypto/src/daemon/BUILDis split intocrypto_daemon_lib, thecrypto_daemonbinary and the test targets. The binary keeps itsdynamic_depsfor@score_openssl//:dynamic_openssl_enabled.ProcessRunner.start()records the exit status of the started process, and the newexit_code()returns it. The ITF test now checks that the daemon exits with 0 after SIGTERM, and that it refuses to start with an invalid config file.Behaviour changes:
LifeCycleManagerhandles SIGTERM only, so SIGINT (Ctrl+C) now ends the daemon without draining sessions. CI and the ITF tests stop the daemon with SIGTERM.kRunningas the ready condition.Out of scope:
Related ticket
closes #470