Homec4science

Raise setup warnings immediately when failing to load configuration from the…

Authored by epriestley <git@epriestley.com> on Sep 6 2016, 21:52.

Description

Raise setup warnings immediately when failing to load configuration from the database

Summary:
Ref T11589. Previously, when we failed to load database configuration we just continued anyway, in order to get to setup checks so we could raise a better error.

There was a small chance that this could lead to pages running in a broken state, where ONLY that connection failed and everything else worked. This was accidentally fixed by narrowing the exceptions we continue on in D16489.

However, this "fix" meant that users no longer got helpful setup instructions. Instead:

  • Keep throwing these exceptions: it's bad to continue if we've failed to connect to the database.
  • However, catch them and turn them into setup errors.
  • Share all the setup code so these errors and setup check errors work the same way.

Test Plan:

  • Intentionally broke mysql.host and mysql.pass.
  • Loaded pages.
  • Got good setup errors.
  • Hit normal setup errors too.
  • Put everything back.
  • Swapped into cluster mode.
  • Intentionally broke cluster mode, saw failover to readonly.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T11589

Differential Revision: https://secure.phabricator.com/D16501

Details

Committed
epriestley <git@epriestley.com>Sep 6 2016, 23:20
Pushed
aubortJan 31 2017, 17:16
Parents
rPH309960146344: Split setup check phases into "preflight" and "post-config"
Branches
Unknown
Tags
Unknown

Event Timeline

epriestley <git@epriestley.com> committed rPH00bb0c907147: Raise setup warnings immediately when failing to load configuration from the… (authored by epriestley <git@epriestley.com>).Sep 6 2016, 23:20