forgejo/modules/indexer/code
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
..
bleve.go Remove git.Command.Run and git.Command.RunInDir* (#19280) 2022-04-01 10:55:30 +08:00
bleve_test.go Decouple unit test code from business code (#17623) 2021-11-12 22:36:47 +08:00
elastic_search.go Remove git.Command.Run and git.Command.RunInDir* (#19280) 2022-04-01 10:55:30 +08:00
elastic_search_test.go Decouple unit test code from business code (#17623) 2021-11-12 22:36:47 +08:00
git.go Remove git.Command.Run and git.Command.RunInDir* (#19280) 2022-04-01 10:55:30 +08:00
indexer.go Prevent dangling archiver goroutine (#19516) 2022-04-26 19:22:26 -04:00
indexer_test.go Use a struct as test options (#19393) 2022-04-14 21:58:21 +08:00
search.go Automatically pause queue if index service is unavailable (#15066) 2022-01-27 10:30:51 +02:00
wrapped.go Automatically pause queue if index service is unavailable (#15066) 2022-01-27 10:30:51 +02:00