Repository navigation
feat: support optional operational file log sinks - #1484
Conversation
Add a required-by-default per-file startup failure policy. Skip optional filesystem initialization failures while preserving healthy sinks, bounded diagnostic evidence, and strict configuration validation. Cover core, CLI/daemon, and binding startup behavior and document record loss and reinitialization. Signed-off-by: Bryan Bednarski <[email protected]>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📜 Recent review details
WalkthroughFile sinks now default to required startup behavior and can be configured as optional. Optional sinks that fail filesystem initialization are disabled while healthy sinks continue. The change adds sink-specific diagnostics, CLI configuration support, integration tests, and documentation. ChangesFile-sink startup policy
Priority: ➖ Normal Estimated code review effort: 4 (Complex) | ~45 minutes Change: Feature · Severity of issue fixed: Medium Sequence Diagram(s)sequenceDiagram
participant LoggingRuntime
participant build_logger_with_diagnostics
participant FileSink
participant SinkDiagnostics
participant HealthySink
LoggingRuntime->>build_logger_with_diagnostics: build logger and validate destinations
build_logger_with_diagnostics->>FileSink: open configured file
FileSink-->>build_logger_with_diagnostics: return filesystem open error
build_logger_with_diagnostics->>SinkDiagnostics: record sanitized initialization failure
build_logger_with_diagnostics->>HealthySink: install healthy sink
build_logger_with_diagnostics-->>LoggingRuntime: return installed and unavailable sink positions
Possibly related PRs
Merge Risk: ⚪ Minimal · up to
|
Overview
Allow each operational file log sink to opt into best-effort startup, so unavailable log storage does not prevent an otherwise usable Relay runtime or daemon from starting. Required sinks retain strict startup behavior by default.
Details
failure_policy = "required" | "optional"to individual file sinks, including[daemon.logging], configuration layering, and the interactive editor. Rust callers useFileLogSinkFailurePolicy.Rust source compatibility: exhaustive
FileLogSinkConfigstruct literals must provide the newfailure_policyfield or use..Default::default(). Existing TOML configurations continue to default to required sinks.Validation:
just test-rust: 6,470 passed, 4 skipped.just test-python: 86 Rust bridge tests, 1,175 Python tests, and 24 example tests passed.just test-node: 6 Rust bridge tests, 521 Node.js tests, and 26 example tests passed.just --set ci true test-go: all packages passed using the shared debug build.git diff --checkpassed.Where should the reviewer start?
Start with
crates/core/src/logging/sink.rsfor validation and the narrow filesystem-failure boundary, thencrates/core/src/logging/mod.rsfor sink identity and late diagnostics attachment. Review the startup policy incrates/core/src/logging/config.rsand the regression cases incrates/core/tests/coverage/logging_tests.rsandcrates/cli/tests/runtime_diagnostics_tests.rs.Related Issues: (use one of the action keywords Closes / Fixes / Resolves / Relates to)
Summary by CodeRabbit
optionallets the application start and continue writing to healthy sinks.