When running in broadcast mode make sure that PDB properly closes all connections to the write dbs on an error. Could be a good case to look into [Murphy|https://gitlab.com/clj-murphy/murphy] to make sure we get the error handling right if we throw again while shutting down.
Specifically look into init behavior of PuppetDBCommandDispatcher service. An error during service init can cause resources in the context to be nil when they're used later in another service's start method. To fix this properly we would need to update trapperkeeper's behavior where it can call start methods after a failure in init. As a work around without the tk changes we could move any setup code out of our init method in the command dispatch service.