zeripath 270c7f36db
Correctly rollback in ForkRepository (#17034) (#17045)
Backport #17034

The rollback functionality in
services/repository/repository.go:ForkRepository is incorrect and could
lead to a deadlock as it uses DeleteRepository to delete the rolled-back
repository - a function which creates its own transaction.

This PR adjusts the rollback function to only use RemoveAll as any
database changes will be automatically rolled-back. It also handles
panics and adjusts the Close within WithTx to ensure that if there is a
panic the session will always be closed.

Signed-off-by: Andrew Thornton <art27@cantab.net>

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2021-09-15 08:42:09 +03:00
..
2021-05-16 19:58:26 +08:00
2021-06-29 22:00:02 +01:00
2021-04-05 08:41:22 +01:00
2021-06-25 16:28:55 +02:00
2021-04-19 18:25:08 -04:00
2021-06-07 07:27:09 +02:00
2021-05-01 22:51:03 -04:00
2020-08-16 23:07:38 -04:00
2021-06-25 12:59:25 -04:00