-
Notifications
You must be signed in to change notification settings - Fork 127
Bootstrap file's hardcoded endpoints section is erased #174
Comments
This certainly requires a unit test in that rs file for sure. |
Looks like the code is doing the right thing, overwriting the cache file if it can't read/parse it. Just connected crust_peer to droplets using the same file (removed
|
I will add a log statement to say its fails to read the file. Also there is a test already to write and read the file. |
Valid bootstrap cache file
|
I have re-opend this issue as I think the app should exit with a message stating the file is invalid, allowing the user to fix or delete it. The return code should indicate invalid boostrap-cache file |
Are you talking about Crust invoking something like I suppose for our normal use (i.e. where we're not tinkering around with the file for testing purposes) it would be unlikely that the file would be corrupted, and such a problem is maybe serious enough to warrant termination. But I'm not sure if that should be forced on all users of Crust. Maybe a middle ground of abandoning the bootstrap process by returning an |
Yes it's normal for a process with a config file to abort on file read error. Apache, ftp servers, mail servers etc. all would do that as it means the user may have been trying to set something and did it wrong. So I think it's an expected thing to happen. Personally I would go for exit with a negative return code as we cannot tell if a user is trying to alter the file or if it's actually corrupted, or they have just made a mistake. We could add an option to start again with over-write etc. but then again maybe that's just taking it to far. |
It may be the file needs split, a config part where we would exit and purely cache part where we would over-write. |
+1 for the split between config and cache. I will detail a task to address this. |
Added JIRA task to address this issue. |
I ran a Client example with a bootstrap file containing the following at the start:
After the example ran, it contained:
The text was updated successfully, but these errors were encountered: