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
Error in post-attach does not undo the operation #208
Comments
Only the Will add another note, at the example. |
This is not an issue on The issue is that any error should rollback to the previous state and undo the operation, but that is not the case. |
Got your point. The rollback may be complicated. It is just another operation on tree, which cause another pre/post-hookup-processing. Which might cause errors as well. And how to handle them. My decision was to keep-it-simple. pre-hookup errors prevent the tree manipulation. post-hookups not. This is what is also clearly stated in the documentation. What is your exact use case for handling the post-hookup errors? |
Yeah understand that it is complicated to implement. I was thinking of using a try-except clause where the usual flow is within the A possible use case would be to use pre-attach and post-attach to check the tree state. If there are errors in pre- or post-attach checks, then a rollback should happen such that the tree does not exist in an illegal state. |
I am aware of the try-except approach. Nevertheless, it gets quite complicated if the rollback fails too. Would like to skip for now. |
Taking the read-only example and implementing checks on post_attach instead of pre_attach, it does not undo the operation that is supposed to be atomic.
Sample code to replicate the issue below,
The text was updated successfully, but these errors were encountered: