bench-forgejo/services
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
..
agit Remove git.Command.Run and git.Command.RunInDir* (#19280) 2022-04-01 10:55:30 +08:00
asymkey Use a struct as test options (#19393) 2022-04-14 21:58:21 +08:00
attachment Use a struct as test options (#19393) 2022-04-14 21:58:21 +08:00
auth Remove dependent on session auth for api/v1 routers (#19321) 2022-04-08 06:22:10 +02:00
comments Move some issue methods as functions (#19255) 2022-03-29 16:57:33 +02:00
context Add ContextUser to http request context (#18798) 2022-03-26 17:04:22 +08:00
cron Remove legacy unmaintained packages, refactor to support change default locale (#19308) 2022-04-03 17:46:48 +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) 2022-03-31 16:53:08 +02:00
gitdiff Use a struct as test options (#19393) 2022-04-14 21:58:21 +08:00
issue Use a struct as test options (#19393) 2022-04-14 21:58:21 +08:00
lfs Update HTTP status codes to modern codes (#18063) 2022-03-23 12:54:07 +08:00
mailer Use a struct as test options (#19393) 2022-04-14 21:58:21 +08:00
migrations User specific repoID or xorm builder conditions for issue search (#19475) 2022-04-25 16:06:24 +02:00
mirror Remove git.Command.Run and git.Command.RunInDir* (#19280) 2022-04-01 10:55:30 +08:00
org Use a struct as test options (#19393) 2022-04-14 21:58:21 +08:00
packages Package registry changes (#19305) 2022-04-06 03:32:09 +02:00
pull Add commit status popup to issuelist (#19375) 2022-04-26 23:40:01 +01:00
release Use a struct as test options (#19393) 2022-04-14 21:58:21 +08:00
repository Prevent dangling archiver goroutine (#19516) 2022-04-26 19:22:26 -04:00
task Use a more general (and faster) method to sanitize URLs with credentials (#19239) 2022-03-31 10:25:40 +08:00
user Use a struct as test options (#19393) 2022-04-14 21:58:21 +08:00
webhook Use queue instead of memory queue in webhook send service (#19390) 2022-04-25 20:03:01 +02:00
wiki Use a struct as test options (#19393) 2022-04-14 21:58:21 +08:00