-
Notifications
You must be signed in to change notification settings - Fork 73
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
add revert failed cb #550
add revert failed cb #550
Conversation
The compile error for fcgi is fixed in commit 73183c4. Can you please rebase? |
HI @olofhagsand! |
apps/backend/backend_plugin.c
Outdated
@@ -848,6 +862,8 @@ plugin_transaction_commit_all(clixon_handle h, | |||
while ((cp = clixon_plugin_each(h, cp)) != NULL) { | |||
i++; | |||
if (plugin_transaction_commit_one(cp, h, td) < 0){ | |||
/*First make an effort ro revert transaction for the failed plugin*/ | |||
plugin_transaction_revert_failed(cp, h, td); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is called after a commit failed, maybe the name of the callback should be "commit-failed"?
Also, maybe one should handle the return value of the call, could it be that one wants to stop the following plugin_transaction_revert_all() call, or do you want it to continue uninterrupted?
(Minor: please have an initial space in the comment: /*First make an
--> /* First make an
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@olofhagsand ,
Since this is called after a commit failed, maybe the name of the callback should be "commit-failed"?
Agree w/ you, will rename.
Also, maybe one should handle the return value of the call, could it be that one wants to stop the following plugin_transaction_revert_all() call, or do you want it to continue uninterrupted?
I believe it's better to follow the same logic as normal revert. The difference should be in the code placed inside this callback. Developer have to consider if the changes within transaction data has been succesfully applied to the underlying system during commit or not and incrementally apply reverse rules and operations. But all of this is up to developer and customization features.
(Minor: please have an initial space in the comment: /*First make an --> /* First make an
yep, will do
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @olofhagsand,
I've made changes discussed above, pls check.
Also, the transaction callback description needs to be amended https://clixon-docs.readthedocs.io/en/latest/backend.html#transactions |
done with this |
* add revert failed cb * add revert failed cb * add commit failed cb * add commit failed cb
* add revert failed cb * add revert failed cb * add commit failed cb * add commit failed cb
Hello @olofhagsand
Following this conversation #517
Could you pls check if it possible to merge this PR?
Current callback order: