boulder/observer
Jacob Hoffman-Andrews a2b2e53045
cmd: fail without panic (#6935)
For "ordinary" errors like "file not found" for some part of the config,
we would prefer to log an error and exit without logging about a panic
and printing a stack trace.

To achieve that, we want to call `defer AuditPanic()` once, at the top
of `cmd/boulder`'s main. That's so early that we haven't yet parsed the
config, which means we haven't yet initialized a logger. We compromise:
`AuditPanic` now calls `log.Get()`, which will retrieve the configured
logger if one has been set up, or will create a default one (which logs
to stderr/stdout).

AuditPanic and Fail/FailOnError now cooperate: Fail/FailOnError panic
with a special type, and AuditPanic checks for that type and prints a
simple message before exiting when it's present.

This PR also coincidentally fixes a bug: panicking didn't previously
cause the program to exit with nonzero status, because it recovered the
panic but then did not explicitly exit nonzero.

Fixes #6933
2023-06-20 12:29:02 -07:00
..
probers Don't update the notAfter Gauge with zeros (#6924) 2023-05-31 14:19:28 -04:00
mon_conf.go config: Add validation tags to all configuration structs (#6674) 2023-03-21 14:08:03 -04:00
mon_conf_test.go Move cmd.ConfigDuration to config.Duration (#6705) 2023-02-28 08:11:49 -08:00
monitor.go observer: Monitors probe immediately instead of waiting a full duration (#6594) 2023-01-24 16:45:19 -05:00
obs_conf.go cmd: fail without panic (#6935) 2023-06-20 12:29:02 -07:00
obs_conf_test.go Move cmd.ConfigDuration to config.Duration (#6705) 2023-02-28 08:11:49 -08:00
observer.go Introduce OpenTelemetry Tracing (#6750) 2023-04-21 10:46:59 -07:00