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

Fixed infinite loop due to not gathering the error reliably. #141

Merged
merged 2 commits into from
Nov 30, 2018

Conversation

mbeckerle
Copy link
Contributor

Problem is that a regular scala lazy val x = expression
If the expression throws, this lazy val will be re-evaluated over and
over each time it is requested.

That's why we have the LV system. This insures such values are attempted
exactly once, and if they throw, the fact that they threw is remembered,
and they're not attempted again.

To reduce overhead we've taken out a bunch of the LVs. But this results
in compiler errors that ripple. When parts of the compiler can't be LVs
because they are methods with parameters, it's important to CALL such
methods from something that IS an LV so that if an error is thrown, it's not
repeatedly thrown.

So a number of LVs have been put back in. Especially on things that
involve recursive descent or traversal of the DSOM objects or
corresponding XML.

This also fixes some other minor bugs which were being masked. E.g., a
test for hiddenGroupRef where the ref is empty string. I also renamed this
test since it was poorly named.

DAFFODIL-2202

Copy link
Member

@stevedlawrence stevedlawrence left a comment

Choose a reason for hiding this comment

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

+1

Copy link
Contributor

@jadams-tresys jadams-tresys left a comment

Choose a reason for hiding this comment

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

+1

This error situation was causing an infinite loop before. No longer
does.

The test is badElementFormProperty2.

Problem is that a regular scala lazy val x = expression
If the expression throws, this lazy val will be re-evaluated over and
over each time it is requested.

That's why we have the LV system. This insures such values are attempted
exactly once, and if they throw, the fact that they threw is remembered,
and they're not attempted again.

To reduce overhead we've taken out a bunch of the LVs. But this results
in compiler errors that ripple. When parts of the compiler can't be LVs
because they are methods with parameters, it's important to CALL such
methods from something that IS an LV so that if an error is thrown, it's
not
repeatedly thrown.

So a number of LVs have been put back in. Especially on things that
involve recursive descent or traversal of the DSOM objects or
corresponding XML.

This also fixes some other minor bugs which were being masked. E.g., a
test for hiddenGroupRef where the ref is empty string. I also renamed
this
test since it was poorly named.

DAFFODIL-2202
@mbeckerle mbeckerle merged commit 6239df2 into apache:master Nov 30, 2018
@mbeckerle mbeckerle deleted the daffodil-2202-property branch November 30, 2018 21:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants