pkg/conf: Add deadlock detector for frontend
Created by: ggilmore
Many packages that we have use conf.Watch
or conf.Get
in their init
functions. Such packages are included in frontend
's dependencies. Since frontend
is responsible for serving the configuration to everyone else, it's possible to get into a situation where one of frontend's dependencies' init
functions will block forever since frontend
hasn't been initialized yet (and can't be until its dependencies have been initialized).
The solution is to make sure that calls to pkg/conf
never block the init
function.
This PR:
- Adds a detector that will
panic
if you're trying to callconf.Get
orconf.Watch
beforefrontend
has been initialized - Fixes a couple deadlocks due to these issues