-
Notifications
You must be signed in to change notification settings - Fork 4.1k
*: prefer log.Fatal to panic for assertions #16479
Copy link
Copy link
Closed
Labels
C-cleanupTech debt, refactors, loose ends, etc. Solution not expected to significantly change behavior.Tech debt, refactors, loose ends, etc. Solution not expected to significantly change behavior.S-3-productivitySevere issues that impede the productivity of CockroachDB developers.Severe issues that impede the productivity of CockroachDB developers.
Milestone
Description
panic causes stacks to unwind and defers to be invoked (possibly releasing locks) until eventually something either handles the panic (unlikely) or we reach the runtime and it kills the process. While the process is dying, other goroutines are still running which may encounter invalid states due to the panic. For fatal errors we should use log.Fatal{,f} instead which will kill the process before any locks are released.
I'm not sure if a massive search-and-replace is warranted, but some key packages such as storage deserve attention.
See #16460 for motivation.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
C-cleanupTech debt, refactors, loose ends, etc. Solution not expected to significantly change behavior.Tech debt, refactors, loose ends, etc. Solution not expected to significantly change behavior.S-3-productivitySevere issues that impede the productivity of CockroachDB developers.Severe issues that impede the productivity of CockroachDB developers.