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

Exception safety guarantees #32

Open
hu55a1n1 opened this issue Dec 9, 2021 · 0 comments
Open

Exception safety guarantees #32

hu55a1n1 opened this issue Dec 9, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@hu55a1n1
Copy link
Member

hu55a1n1 commented Dec 9, 2021

basecoin-rs doesn't provide any exception safety guarantees as of now. The reason for this is that we only provide a volatile in-memory data store currently. But this is definitely something we should address.

Proposal

One way to provide strong guarantees and the ability to recover from crash failures would be to record pending data-store changes on failure. This can be done in a couple of ways ->

  • std::panic::set_hook() and panic_any!() to pass the app state to the panic handler and printing pending writes from the RevertibleStore.
  • Using RevertibleStore's Drop to write the pending writes to stderr.
@hu55a1n1 hu55a1n1 mentioned this issue Dec 9, 2021
3 tasks
@hu55a1n1 hu55a1n1 added the enhancement New feature or request label Jan 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant