Skip to content

Prevent dangling archiver goroutine (#19516) #19526

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 1 commit into from
Apr 27, 2022
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 @@ -130,7 +130,7 @@ func Init() {
log.Info("PID: %d Repository Indexer closed", os.Getpid())
})

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 @@ -98,7 +98,7 @@ var (
// InitIssueIndexer initialize issue indexer, syncReindex is true then reindex until
// all issue index done.
func InitIssueIndexer(syncReindex bool) {
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 @@ -169,7 +169,7 @@ func doArchive(r *ArchiveRequest) (*repo_model.RepoArchiver, error) {
w.Close()
rd.Close()
}()
var 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