Skip to content

pkg/conf: Add deadlock detector for frontend

Warren Gifford requested to merge conf-async into master

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:

  1. Adds a detector that will panic if you're trying to call conf.Get or conf.Watch before frontend has been initialized
  2. Fixes a couple deadlocks due to these issues

Merge request reports

Loading