Skip to content
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

Fix an assorted list of goroutine leaks. #3074

Merged
merged 1 commit into from
Feb 28, 2019
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 dgraph/cmd/zero/zero.go
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,7 @@ func (s *Server) UpdateMembership(ctx context.Context, group *pb.Group) (*api.Pa
ctx, cancel := context.WithCancel(ctx)
defer cancel()

errCh := make(chan error)
errCh := make(chan error, len(proposals))
for _, pr := range proposals {
go func(pr *pb.ZeroProposal) {
errCh <- s.Node.proposeAndWait(ctx, pr)
Expand Down
2 changes: 1 addition & 1 deletion worker/backup_ee.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ func BackupOverNetwork(pctx context.Context, dst string) error {

// This will dispatch the request to all groups and wait for their response.
// If we receive any failures, we cancel the process.
errCh := make(chan error, 1)
errCh := make(chan error, len(gids))
for _, gid := range gids {
go func(gid uint32) {
req.GroupId = gid
Expand Down
4 changes: 2 additions & 2 deletions worker/task.go
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ func (qs *queryState) handleValuePostings(ctx context.Context, args funcArgs) er
x.AssertTrue(width > 0)
span.Annotatef(nil, "Width: %d. NumGo: %d", width, numGo)

errCh := make(chan error, 1)
errCh := make(chan error, numGo)
outputs := make([]*pb.Result, numGo)
listType := schema.State().IsList(q.Attr)

Expand Down Expand Up @@ -544,7 +544,7 @@ func (qs *queryState) handleUidPostings(
x.AssertTrue(width > 0)
span.Annotatef(nil, "Width: %d. NumGo: %d", width, numGo)

errCh := make(chan error, 1)
errCh := make(chan error, numGo)
outputs := make([]*pb.Result, numGo)

calculate := func(start, end int) error {
Expand Down