Make stderr output exclusive to fatal paths and consistent across all fatal paths
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 35/100
- issue の種類
- 機能追加
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
調査の方向性
Start by reading the console logger and fatal reporting code in include/ccf/ds/logger.h and src/host/runtime_control.h, then trace the join callers in src/node/node_state.h and the post-join failure examples in src/node/rpc/frontend.h and src/host/socket.h. Review the Rust panic-hook handling in src/rust/ccf-app/src/lib.rs and existing regression tests for process output. Done means documenting the stderr contract and scope, covering fatal and recoverable paths, and ensuring fatal diagnostics avoid confidential request or KV data.
索引モデルが issue の本文から書いたものです。
説明
Is your feature request related to a problem? Please describe.
CCF's stderr is not currently a consistent indicator of fatal failure.
Some fatal paths write to stderr, while others log only to stdout before aborting or exiting.
Operators therefore cannot rely on an empty stderr to mean that no fatal error occurred, or use stderr alone to capture fatal diagnostics.
Source inspection found the following behavior:
- Normal framework and application logging uses stdout at every severity, including
failandfatal, for both text and JSON console loggers.LOG_FATAL_FMTandCCF_APP_FATALdo not themselves terminate execution or write to stderr. RuntimeControlImpl::report_fatal_error()writes and flushes the first reported error to stderr, then requests enclave shutdown. All four current production call sites are on the join path: oversized join responses; non-retryable transport/TLS failures, including certificate trust failures; fatal join client errors, except the supported fresh-snapshot retry case; and startup-snapshot installation failures during join completion.- CLI11 writes command-line parsing errors to stderr. Help and version output use stdout.
files::slurp()writes required-file open/read failures to stderr and exits whenoptional == false.- Post-join fatal paths can log to stdout and call
abort()without a CCF stderr diagnostic. Examples include transaction serialisation failure in the RPC frontend and socket resolve/listen failure handlers.abort()itself does not print a diagnostic; a supervising shell may separately report the signal. - Native assertion failures can emit stderr diagnostics when assertions are enabled. Uncaught C++ exceptions and Rust's default panic hook can also produce runtime diagnostics. The experimental Rust SDK suppresses panic diagnostics for caught application-callback panics, but forwards other panics to the previously installed hook.
- Applications and dependencies can write directly to stderr, for example through Rust's
eprint!/eprintln!. Such output is not governed by CCF's logger today.
Describe the solution you'd like
Establish and enforce the following contract for CCF node stderr:
- Only fatal paths write to stderr. Recoverable errors, warnings, and ordinary application logging must not produce stderr output.
- All fatal paths consistently write a useful diagnostic to stderr before the node terminates, including failures after joining the network. This must not depend on whether the path uses
report_fatal_error(), logs and aborts, or exits through another mechanism.
Preserve useful stdout logging while ensuring stderr has the same meaning across startup, join, and steady-state operation.
Document the contract and its scope, including application/dependency writes and runtime-generated diagnostics.
Distinguish actual fatal termination paths from the fatal log-level label: emitting a log entry at that level does not currently imply termination.
Fatal diagnostics must not expose confidential request or KV data.
Add regression coverage demonstrating both sides of the contract: fatal paths emit stderr diagnostics, and recoverable paths do not.
Describe alternatives you've considered
Continue parsing stdout severity labels and combining them with process exit status.
This leaves stderr inconsistent, and the fatal severity label alone is not equivalent to a fatal termination path.
Routing all fail or fatal log entries to stderr without considering control flow would not establish the requested fatal-path-only contract.
Additional context
Findings are based on source inspection at commit 4bb1570da7264b0daa417f2c6e4e497124f0b8d0, rather than an exhaustive runtime reproduction.
Relevant source locations:
- 主要言語
- C++
- スター
- 876
- フォーク
- 264
- 平均マージ
- 1日 16時間
- マージ済み PR(30日)
- 127
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
microsoft/CCF のほかの issue
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
microsoft/CCF#8688 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 8/100
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
メンテナーはふだん 1 日以内に返信
-
raft.h hardeningオープン
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
microsoft/CCF#8606 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
似ている issue
-
go perft exits when EvalFile is unavailable対応中かも @Muawiya-contact が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
official-stockfish/Stockfish#7292 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
arvidn/libtorrent#9149 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
Niko1221/Strata#5560 · コメント 2 件 ·
メンテナーはふだん 4 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
hyprwm/xdg-desktop-portal-hyprland#453 · コメント 1 件 ·