gitea/services/repository
zeripath 41fcf7b7de
Prevent dangling archiver goroutine (#19516)
Within doArchive there is a service goroutine that performs the
archiving function.  This goroutine reports its error using a `chan
error` called `done`. Prior to this PR this channel had 0 capacity
meaning that the goroutine would block until the `done` channel was
cleared - however there are a couple of ways in which this channel might
not be read.

The simplest solution is to add a single space of capacity to the
goroutine which will mean that the goroutine will always complete and
even if the `done` channel is not read it will be simply garbage
collected away.

(The PR also contains two other places when setting up the indexers
which do not leak but where the blocking of the sending goroutine is
also unnecessary and so we should just add a small amount of capacity
and let the sending goroutine complete as soon as it can.)

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

Co-authored-by: 6543 <6543@obermui.de>
2022-04-26 19:22:26 -04:00
..
archiver Prevent dangling archiver goroutine (#19516) 2022-04-26 19:22:26 -04:00
files RepoAssignment ensure to close before overwrite (#19449) 2022-04-21 17:17:57 +02:00
adopt.go Remove `git.Command.Run` and `git.Command.RunInDir*` (#19280) 2022-04-01 10:55:30 +08:00
adopt_test.go format with gofumpt (#18184) 2022-01-20 18:46:10 +01:00
avatar.go Some repository refactors (#17950) 2021-12-12 23:48:20 +08:00
avatar_test.go Some repository refactors (#17950) 2021-12-12 23:48:20 +08:00
branch.go Use full output of git show-ref --tags to get tags for PushUpdateAddTag (#19235) 2022-03-29 19:12:33 +02:00
cache.go Move repository model into models/repo (#17933) 2021-12-10 09:27:50 +08:00
check.go Remove `git.Command.Run` and `git.Command.RunInDir*` (#19280) 2022-04-01 10:55:30 +08:00
fork.go Remove `git.Command.Run` and `git.Command.RunInDir*` (#19280) 2022-04-01 10:55:30 +08:00
fork_test.go Make git.OpenRepository accept Context (#19260) 2022-03-30 03:13:41 +08:00
hooks.go Make git.OpenRepository accept Context (#19260) 2022-03-30 03:13:41 +08:00
main_test.go Use a struct as test options (#19393) 2022-04-14 21:58:21 +08:00
push.go Make git.OpenRepository accept Context (#19260) 2022-03-30 03:13:41 +08:00
repository.go Add Package Registry (#16510) 2022-03-30 16:42:47 +08:00
template.go Some repository refactors (#17950) 2021-12-12 23:48:20 +08:00
transfer.go Move organization related structs into sub package (#18518) 2022-03-29 14:29:02 +08:00
transfer_test.go Move organization related structs into sub package (#18518) 2022-03-29 14:29:02 +08:00