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 7 months ago
Owner

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 empty meta.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/or rm 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.

cc @taigrr This PR will _hopefully_ help to fix some critical isseus in the real world with several or more [Yarn.social](https://yarn.social) pods running [yarnd](https://git.mills.io/yarnsocial/yarn) where starting back up after a power failure or crash can sometimes result in an empty `config.json` or empty `meta.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/or `rm 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.
prologic added 1 commit 7 months ago
prologic added 1 commit 7 months ago
prologic merged commit 5429693cc8 into master 7 months ago
prologic deleted branch bad_config_metadata_errors 7 months ago
continuous-integration/drone/pr Build is passing
The pull request has been merged as 5429693cc8.
Sign in to join this conversation.
Loading…
There is no content yet.