Skip to content

searcher: main function split out into run which returns error

Administrator requested to merge k/20220422-searcher-reorg into main

Created by: keegancsmith

I was looking into our new logging library and wanted to remove our calls to log in main. This is a first commit which instead makes it so we return an error. Our new logging library doesn't have the concept of fatal, so will handle that manually now in one place.

A few changes included in this commit to make us return error and not fatal everywhere:

  • ensureFrontendDB returns an error
  • shutdownOnSignal extracted and now returns an error
  • errgroup to handle goroutines returning error instead of fataling

There are also two functional changes:

  • on the second shutdown signal we now have a non-zero exit code. I believe this was an oversight before.
  • Failing to Shutdown in time causes a non-zero exit code.

Test Plan: main dry run to ensure searcher binary starts up correctly and shutsdown correctly.

Merge request reports

Loading