1
1
mirror of https://github.com/go-gitea/gitea synced 2024-06-16 08:15:47 +00:00
gitea/services
zeripath 39a0db6ecf
Prevent dangling archiver goroutine (#19516) (#19526)
Backport #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>

Co-authored-by: 6543 <6543@obermui.de>
2022-04-27 16:05:52 +08:00
..
agit Fix various typos (#18219) 2022-01-10 17:32:37 +08:00
asymkey Refactor auth package (#17962) 2022-01-02 21:12:35 +08:00
attachment Simplify parameter types (#18006) 2021-12-20 04:41:31 +00:00
auth Restore user autoregistration with email addresses (#19261) (#19312) 2022-04-02 20:36:47 -04:00
comments Move repository model into models/repo (#17933) 2021-12-10 09:27:50 +08:00
cron Some repository refactors (#17950) 2021-12-12 23:48:20 +08:00
externalaccount Refactor auth package (#17962) 2022-01-02 21:12:35 +08:00
forms Move checks for pulls before merge into own function (#19271) (#19277) 2022-03-31 16:57:13 +02:00
gitdiff Bump to build with go1.18 (#19120 et al) (#19127) 2022-03-19 18:46:47 +01:00
issue Restore propagation of ErrDependenciesLeft (#18325) 2022-01-19 00:26:42 +01:00
lfs Support webauthn (#17957) 2022-01-14 16:03:31 +01:00
mailer Try to prevent autolinking of displaynames by email readers (#19169) (#19183) 2022-03-23 15:18:11 +02:00
migrations Add notags to fetch (#19487) (#19490) 2022-04-25 20:26:17 +02:00
mirror Use full output of git show-ref --tags to get tags for PushUpdateAddTag (#19235) (#19236) 2022-03-29 23:19:57 +03:00
org Move repository model into models/repo (#17933) 2021-12-10 09:27:50 +08:00
pull Set correct PR status on 3way on conflict checking (#19457) (#19458) 2022-04-22 09:11:42 +08:00
release Set HeadCommit when creating tags. (#18116) 2021-12-29 19:40:57 +08:00
repository Prevent dangling archiver goroutine (#19516) (#19526) 2022-04-27 16:05:52 +08:00
task Some repository refactors (#17950) 2021-12-12 23:48:20 +08:00
user Move keys to models/asymkey (#17917) 2021-12-10 16:14:24 +08:00
webhook Only send webhook events to active system webhooks and only deliver to active hooks (#19234) (#19248) 2022-03-29 14:12:56 +02:00
wiki Fix various typos (#18219) 2022-01-10 17:32:37 +08:00