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 issue with rules introducing loops #16

Merged
merged 1 commit into from
Oct 5, 2017
Merged

Conversation

oscar-stripe
Copy link
Contributor

I hit a bug using dagon with scalding where we have an explicit Fork node in the AST. This node was originally to allow the user to hint that we consumed something more than once.

It turns out to be convenient to use that in planning since in an early phase I could make all forks explicit, which simplifies writing the matching rules. However, this actually causes an infinite loop.

I added some tests to expose the bug, then fixed the issue.

I want to use this in scalding so I am hoping to publish a minor fix soon.

@oscar-stripe oscar-stripe requested a review from non October 5, 2017 06:58
@codecov-io
Copy link

codecov-io commented Oct 5, 2017

Codecov Report

Merging #16 into master will decrease coverage by 0.16%.
The diff coverage is 92.3%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #16      +/-   ##
==========================================
- Coverage   90.45%   90.29%   -0.17%     
==========================================
  Files          12       12              
  Lines         199      206       +7     
  Branches       17       13       -4     
==========================================
+ Hits          180      186       +6     
- Misses         19       20       +1
Impacted Files Coverage Δ
core/src/main/scala/com/stripe/dagon/Dag.scala 93.85% <92.3%> (-0.54%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ea735b7...f97af0a. Read the comment docs.

// possibly lower the nextId, which is a bit
// nice because (unfortunately) Ids wrap Int
// not Long, so overflow is possible
val nextId = id2Exp.keySet.iterator.map(_.id).max
Copy link
Collaborator

Choose a reason for hiding this comment

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

Might be nice to add something to HMap to make this more efficient, but we can do that later.

@non
Copy link
Collaborator

non commented Oct 5, 2017

Seems reasonable to me. 👍

@non
Copy link
Collaborator

non commented Oct 5, 2017

(NOTE: coverage only appears to go down due to one line that is an error about "unreachable code" so I think it's OK. We might want to annotate that line to not require coverage.)

@johnynek johnynek merged commit f9da307 into master Oct 5, 2017
@johnynek johnynek deleted the oscar/fork-test branch October 5, 2017 17:05
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.

4 participants