Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Book: Chapter on "writing robust CLI applications" #53

Open
killercup opened this issue Dec 8, 2018 · 1 comment
Open

Book: Chapter on "writing robust CLI applications" #53

killercup opened this issue Dec 8, 2018 · 1 comment

Comments

@killercup
Copy link
Contributor

Inspired by @vorner's comment (https://github.com/rust-lang-nursery/cli-wg/pull/105#discussion_r240003491).

We should look into adding an in-depth chapter on how to write applications in a robust and well-behaved way. For example, when an application was forcefully terminated (kill -9, power outage, …), it should still be possible to start it again without any issues.

For this to work, several aspects need to be considered. For example,

  • cleaning up or overwriting temporary files from a previous run without issues
  • atomically writing config files so they are not corrupted

Other "robustness" aspects that come to mind:

  • Follow sane resource limits for the current OS (e.g. not open millions of file descriptors on macOS)
  • Try to be both forward and backward compatible with config files and CLI arguments

Noe: As @vorner correctly pointed out, this does not need to be specific to CLI applications!

@vorner
Copy link

vorner commented Dec 8, 2018

Other things that come into mind:

  • If there are any caches, should the app purge it automatically under some circumstances (max size, age of entries, corrupt entries, corrupt whole cache)
  • Running multiple instances of the app
  • 😈 What happens under bad conditions ‒ will it write partial files when it runs out of space? Will it try to load and use that file next time?

@epage epage transferred this issue from rust-cli/team Jul 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants