[Medium][Operability] Startup/config error handling is brittle and sometimes silent #34

Open
opened 2026-03-19 22:43:23 +00:00 by thabeta · 0 comments
Owner

Summary

Several startup/configuration paths either panic or silently ignore errors instead of surfacing actionable failures.

Why this matters

This is a daemon-like system. Startup should fail predictably and explain why. Silent fallback to defaults or panic-based exits make deployment and debugging harder than necessary.

Evidence

Topic config is loaded through Option chaining that silently discards open/read/parse errors:

  • myceliumd-common/src/lib.rs:592-597

DNS enablement panics if UDP port 53 cannot be bound:

  • mycelium/src/dns.rs:95-99

Router construction failure is logged and then panics instead of returning an error:

  • mycelium/src/lib.rs:170-203

There are also multiple other panic-on-invalid-runtime paths in core startup code.

Expected behavior

  • Invalid topic config should return a clear startup error.
  • DNS bind failure should be reported as a structured error or an optional feature failure, not a panic.
  • Core init failures should bubble up through Result.

Actual behavior

  • Some errors are silently swallowed.
  • Some operational failures crash the process via panic.

Suggested fix

  • Replace silent Option-based config loading with explicit Result handling.
  • Treat DNS bind and router init as proper recoverable startup errors.
  • Add integration tests for malformed topic config and unavailable privileged ports.

Risk

Medium operational issue. It increases time-to-diagnosis and makes deployment behavior less predictable than it should be.

## Summary Several startup/configuration paths either panic or silently ignore errors instead of surfacing actionable failures. ## Why this matters This is a daemon-like system. Startup should fail predictably and explain why. Silent fallback to defaults or panic-based exits make deployment and debugging harder than necessary. ## Evidence Topic config is loaded through `Option` chaining that silently discards open/read/parse errors: - `myceliumd-common/src/lib.rs:592-597` DNS enablement panics if UDP port 53 cannot be bound: - `mycelium/src/dns.rs:95-99` Router construction failure is logged and then panics instead of returning an error: - `mycelium/src/lib.rs:170-203` There are also multiple other panic-on-invalid-runtime paths in core startup code. ## Expected behavior - Invalid topic config should return a clear startup error. - DNS bind failure should be reported as a structured error or an optional feature failure, not a panic. - Core init failures should bubble up through `Result`. ## Actual behavior - Some errors are silently swallowed. - Some operational failures crash the process via panic. ## Suggested fix - Replace silent `Option`-based config loading with explicit `Result` handling. - Treat DNS bind and router init as proper recoverable startup errors. - Add integration tests for malformed topic config and unavailable privileged ports. ## Risk Medium operational issue. It increases time-to-diagnosis and makes deployment behavior less predictable than it should be.
Sign in to join this conversation.
No labels
Urgent
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
geomind_code/mycelium_network#34
No description provided.