-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
When transfering repository and database transaction failed, rollback the renames #14864
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
Conversation
4f5be46
to
31094d6
Compare
This probably also needs a panic handler too. My suspicion is that putting the return in a defer would be better: e.g.
Then you can just err = sess.Commit() and return err Something like that. |
It's running beyond on http router, and I think we have already recovery middleware there. |
yes but if there is a panic after the initial rename has occurred but then you're not going to rename back unless you use a recover deferral scheme as I suggest above. |
Signed-off-by: Andrew Thornton <[email protected]>
See lunny#14 |
Signed-off-by: Andrew Thornton <[email protected]>
Use defer to ensure that reporollback occurs
… the renames (go-gitea#14864) Fix go-gitea#14821 Co-authored-by: Andrew Thornton <[email protected]> Co-authored-by: 6543 <[email protected]>
… the renames (#14864) (#14902) Fix #14821 Co-authored-by: Andrew Thornton <[email protected]> Co-authored-by: 6543 <[email protected]> Co-authored-by: Lunny Xiao <[email protected]> Co-authored-by: Andrew Thornton <[email protected]>
Fix #14821