Naming table: handle insertion failures
commit0b47803f327e43d29484adc446b4da01576274a2
authorTatiana Racheva <tatianaracheva@fb.com>
Sat, 18 Apr 2020 03:25:53 +0000 (17 20:25 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Sat, 18 Apr 2020 03:31:56 +0000 (17 20:31 -0700)
treee35bc0520887c34776e323e9f23e12061f3316ae
parentc374ede3c7bbd3f4622ca3b19fe0bb8a0ce8a320
Naming table: handle insertion failures

Summary:
When we fail, we should return collision errors for names we were trying to insert to make investigating easier.

This diff adds:

- catching exceptions from SQLite and returning results for each name that fails to be inserted
- printing all the errors when save finishes
- removing the output file and raising a failure if there are insertion errors in paths that are presumed to be used to generate saved states

`hh_naming_table_builder` isn't used in production currently, so I'm not deleting the saved state file but returning a failure exit code nontheless

Reviewed By: arxanas

Differential Revision: D21080712

fbshipit-source-id: 96fc923b7cdf8c0821eb6baa2bac0d987ad68b85
hphp/hack/src/naming/naming_sqlite.ml
hphp/hack/src/naming/naming_sqlite.mli
hphp/hack/src/naming/naming_table.ml
hphp/hack/src/naming/naming_types.ml
hphp/hack/src/naming/naming_types.mli
hphp/hack/src/server/saveStateService.ml
hphp/hack/src/server/serverMain.ml