Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Registry Scheduling: startup logging goes to stdout, colliding with a stdout audit destination

Aperta Adatta ai principianti
#1,583 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
88/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
rust

Direzione di ricerca

Inizia da crates/registry-scheduling/src/main.rs:7 e confronta la sua configurazione di tracing con quella di crates/registry-relay-v2/src/main.rs:31-41. Configura audit.destination: stdout, avvia Scheduling e verifica che stdout contenga solo righe JSON di audit valide mentre l'output di tracing è su stderr. Il lavoro è completato quando i due flussi di output non si intrecciano più.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

agent-ready area:platform bug criticality:p3 rust triage:needs-implementation

What (Registry Scheduling)

crates/registry-scheduling/src/main.rs:7 calls tracing_subscriber::fmt::init() unconditionally, as the first statement, with no .with_writer(...) override, so tracing logs go to stdout using the default plain-text formatter. Separately, AuditDestinationKind::Stdout (crates/registry-platform-audit/src/writer.rs:216-222) is a supported destination, and Scheduling's AuditConfig.destination (crates/registry-scheduling/src/config.rs:283-299, documented in products/scheduling/RUNTIME-CONFIG.md:84-92) allows audit.destination: stdout. Nothing checks or warns about this combination: RuntimeConfig::validate only validates the destination's own shape, and runtime.rs::open_audit just opens whichever destination is configured. When an operator selects a stdout audit destination, tracing's plain-text log lines and the audit writer's JSON Lines entries interleave on the same stream.

main.rs itself is unchanged by #1560 (its stdout logging predates this PR), but Scheduling's config previously required a mandatory file path for audit (path: PathBuf, no stdout option existed); #1560 added the destination enum with a stdout variant. So the collision this creates is newly reachable through this PR even though the logging call itself is old.

For comparison: crates/registry-relay-v2/src/main.rs:31-41 already sends its tracing output to stderr (.with_writer(std::io::stderr)) in install_operational_logging. crates/registry-evidence/src/main.rs:667-676 has the identical gap as Scheduling (also logs to stdout with no writer override), so this is not scheduling-specific, though this ticket is scoped to Scheduling since that is the assigned claim.

Found while reviewing #1560.

Why it matters

A stdout audit destination is meant to produce a clean JSON Lines stream for a downstream collector. Plain-text tracing lines mixed into that stream will not parse as audit entries; a lenient consumer might silently drop them (masking real log output) and a strict one might choke on the whole stream. Scheduling's formatter is plain-text rather than JSON, so the more likely failure is a JSON Lines consumer failing on non-JSON lines rather than a spurious line being misparsed as an audit record.

Suggested fix

Send tracing output to stderr unconditionally in main.rs, matching the pattern Relay already uses, regardless of which audit destination is configured. This avoids needing tracing initialization to depend on config having been parsed first.

How to test

Configure audit.destination: stdout, start the service, and assert stdout contains only well-formed audit JSON Lines while tracing output appears on stderr.

Lingua principale
Rust
Stelle
2
Fork
0
Merge medio
5h 13m
PR unite (30g)
176

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di registrystack/registry-stack

Tutte le issue di registrystack/registry-stack

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.