Add ErrBadConfig and ErrBadMetadata as errors that consumers can check and use #241
Merged
prologic
merged 2 commits from bad_config_metadata_errors
into master
1 year ago
Loading…
Reference in new issue
There is no content yet.
Delete Branch 'bad_config_metadata_errors'
Deleting a branch is permanent. It CANNOT be undone. Continue?
cc @taigrr
This PR will hopefully help to fix some critical isseus in the real world with several or more Yarn.social pods running yarnd where starting back up after a power failure or crash can sometimes result in an empty
config.json
or emptymeta.json
or both!I'm not actually sure how this can arise, and as yet I haven't been able to reproduce it (I can only assume this has to be failures cases outside of our control); but in any case the application and database is recoverable by simply
rm config.json
and/orrm meta.json
.So this PR makes errors loading the config and metadata first-class errors and exported error types that consumers of the library can use to perform automated recovery without requiring human intervention.
Basiclaly in this case it's no big deal we lost the database config of metadata, we can simply carry on.
5429693cc8
into master 1 year ago5429693cc8
.