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

named groups #392

Merged
merged 7 commits into from
Oct 21, 2016
Merged

named groups #392

merged 7 commits into from
Oct 21, 2016

Conversation

ryane
Copy link
Contributor

@ryane ryane commented Oct 18, 2016

fixes #249
replaces #379

This was referenced Oct 18, 2016
@stevendborrelli
Copy link
Member

Will group clash with settings for things like file ownership, etc?

@ryane
Copy link
Contributor Author

ryane commented Oct 18, 2016

Yeah, I suppose it would (doesn't look like we have any fields call just "group" right now though). Should we rename it back to "lock"? something else?

@rebeccaskinner
Copy link
Contributor

Two nodes that share a group and also have an explicit dependency seems to cause a deadlock. Example:

task.query "a" {
  query = "echo a"
  group = "query"
  depends = ["task.query.b"]
}

task.query "b" {
  query = "echo b"
  group = "query"
}

@rebeccaskinner rebeccaskinner self-assigned this Oct 21, 2016
return len(b.g.Dependencies(b.nodes[i].ID)) > len(b.g.Dependencies(b.nodes[j].ID))
}

func groupDeps(ctx context.Context, g *graph.Graph, group string) (*graph.Graph, error) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any way that we can reasonably break this up to factor out smaller helper functions? Like maybe pulling some of the individual for loops out into helper functions?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I broke out each stage into separate functions.

@rebeccaskinner
Copy link
Contributor

LGTM!

@ryane
Copy link
Contributor Author

ryane commented Oct 21, 2016

thx!

@ryane ryane merged commit ad819bd into master Oct 21, 2016
@ryane ryane deleted the feature/named-groups branch October 21, 2016 15:50
BrianHicks pushed a commit that referenced this pull request Dec 22, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

named locks
3 participants