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 AddExplicitFork #1753

Merged
merged 1 commit into from
Nov 10, 2017
Merged

Fix AddExplicitFork #1753

merged 1 commit into from
Nov 10, 2017

Conversation

johnynek
Copy link
Collaborator

@johnynek johnynek commented Nov 4, 2017

this closes #1747

The problem is that we were sometimes had (a -> b -> ...) and replaces b with a -> b which makes an infinite loop at a.

The solution is just writing the rule more carefully, but it is much more complex.

See the example test we added to dagon:
stripe/dagon#18

cc @fwbrasil @non

case Fork(_) | ForceToDisk(_) => None // these are already forking
case SourcePipe(_) => None // don't need to worry about sources
case IterablePipe(_) => None // don't need to worry about sources
case nonFork if on.fanOut(nonFork) > 1 => Some(Fork(nonFork))
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

this was unsafe. If Fork(nonFork) already exists, then replacing nonFork with Fork(nonFork) creates an infinite loop.

@johnynek
Copy link
Collaborator Author

@ianoc @fwbrasil any chance for a review?

@ianoc
Copy link
Collaborator

ianoc commented Nov 10, 2017

sorry i had read through this mostly before. LGTM

@fwbrasil
Copy link
Contributor

I'm still familiarizing with dagon and the new ast/rules, but LGTM

@johnynek johnynek merged commit 98ea650 into develop Nov 10, 2017
@johnynek johnynek deleted the oscar/fix-add-explicit-fork branch November 10, 2017 22:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Infinite loop in one of the rules
3 participants