New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 838644 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: May 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Feature



Sign in to add a comment

Replace common.RunInParallel with parallel.FanOutIn

Project Member Reported by qyears...@chromium.org, May 1 2018

Issue description

The function RunInParallel seems to similar to FanOutIn. If we can replace all instances of the former with the latter, we can remove RunInParallel from common/common.go.

Places where RunInParallel is used now:

 - frontend/rpc_analyze.go
 - tracker/rpc_workflow_launched.go
 - tracker/rpc_worker_done.go
 - tracker/rpc_worker_launched.go
 - gerrit/poll.go
 - gerrit/rpc_report_results.go

 
Project Member

Comment 1 by bugdroid1@chromium.org, May 8 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/infra/infra/+/c9e0f486e4ed278081a78fba58688f9a4594d23f

commit c9e0f486e4ed278081a78fba58688f9a4594d23f
Author: Quinten Yearsley <qyearsley@chromium.org>
Date: Tue May 08 14:51:05 2018

[tricium] Replace RunInParallel with FanOutIn

RunInParallel would take a slice of `func() error`, run them in parallel, and
return an error if any of the functions returned an error. FanOutIn is similar,
but it takes a function that takes a channel, which the `func() error` are sent
into.

The advantage of replacing this is allows us to remove RunInParallel, reducing
the total amount of code by a little bit, and this may also make Tricium more
similar to other code that uses luci-go libraries.

Bug:  838644 
Change-Id: Iac44566b0a70e77a16ab22e4d1d6cf5d87426b1c
Reviewed-on: https://chromium-review.googlesource.com/1048766
Reviewed-by: Marc-Antoine Ruel <maruel@chromium.org>
Commit-Queue: Quinten Yearsley <qyearsley@chromium.org>

[modify] https://crrev.com/c9e0f486e4ed278081a78fba58688f9a4594d23f/go/src/infra/tricium/appengine/gerrit/poll.go
[modify] https://crrev.com/c9e0f486e4ed278081a78fba58688f9a4594d23f/go/src/infra/tricium/appengine/frontend/rpc_analyze.go
[modify] https://crrev.com/c9e0f486e4ed278081a78fba58688f9a4594d23f/go/src/infra/tricium/appengine/common/common.go
[modify] https://crrev.com/c9e0f486e4ed278081a78fba58688f9a4594d23f/go/src/infra/tricium/appengine/tracker/rpc_worker_launched.go
[modify] https://crrev.com/c9e0f486e4ed278081a78fba58688f9a4594d23f/go/src/infra/tricium/appengine/tracker/rpc_worker_done.go
[modify] https://crrev.com/c9e0f486e4ed278081a78fba58688f9a4594d23f/go/src/infra/tricium/appengine/gerrit/rpc_report_results.go
[modify] https://crrev.com/c9e0f486e4ed278081a78fba58688f9a4594d23f/go/src/infra/tricium/appengine/tracker/rpc_workflow_launched.go

Owner: qyears...@chromium.org
Status: Fixed (was: Available)

Sign in to add a comment