Skip to content

Prevent dangling archiver goroutine #19516

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion modules/indexer/code/indexer.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ func Init() {
finished()
})

waitChannel := make(chan time.Duration)
waitChannel := make(chan time.Duration, 1)

// Create the Queue
switch setting.Indexer.RepoType {
Expand Down
2 changes: 1 addition & 1 deletion modules/indexer/issues/indexer.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ var (
func InitIssueIndexer(syncReindex bool) {
ctx, _, finished := process.GetManager().AddTypedContext(context.Background(), "Service: IssueIndexer", process.SystemProcessType, false)

waitChannel := make(chan time.Duration)
waitChannel := make(chan time.Duration, 1)

// Create the Queue
switch setting.Indexer.IssueType {
Expand Down
2 changes: 1 addition & 1 deletion services/repository/archiver/archiver.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ func doArchive(r *ArchiveRequest) (*repo_model.RepoArchiver, error) {
w.Close()
rd.Close()
}()
done := make(chan error)
done := make(chan error, 1) // Ensure that there is some capacity which will ensure that the goroutine below can always finish
repo, err := repo_model.GetRepositoryByID(archiver.RepoID)
if err != nil {
return nil, fmt.Errorf("archiver.LoadRepo failed: %v", err)
Expand Down