This repository has been archived on 2023-02-01. You can view files and clone it, but cannot push or open issues or pull requests.
gitea/modules/indexer/code
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
..
bleve.go Upgrade bleve from v2.0.6 to v2.3.0 (#18132) 2022-01-01 16:26:27 +08:00
bleve_test.go Decouple unit test code from business code (#17623) 2021-11-12 22:36:47 +08:00
elastic_search.go Prevent hang in git cat-file if repository is not a valid repository and other fixes (#17991) 2021-12-16 19:01:14 +00:00
elastic_search_test.go Decouple unit test code from business code (#17623) 2021-11-12 22:36:47 +08:00
git.go Move repository model into models/repo (#17933) 2021-12-10 09:27:50 +08:00
indexer.go Prevent dangling archiver goroutine (#19516) (#19526) 2022-04-27 16:05:52 +08:00
indexer_test.go Add missing X-Total-Count and fix some related bugs (#17968) 2021-12-15 13:39:34 +08:00
search.go Add .gitattribute assisted language detection to blame, diff and render (#17590) 2021-11-17 20:37:00 +00:00
wrapped.go Move repository model into models/repo (#17933) 2021-12-10 09:27:50 +08:00