Project

General

Profile

Feature #7318

prevent abend during conversion in case of failures when processing TRPL rules

Added by Constantin Asofiei about 3 years ago. Updated 2 months ago.

Status:
Test
Priority:
Normal
Target version:
-
Start date:
Due date:
% Done:

100%

billable:
No
vendor_id:
GCD
case_num:
version_reported:
version_resolved:
trunk/16567
reviewer:
production:
No
env_name:
topics:

Related issues

Related to Conversion Tools - Feature #7179: rework the conversion process to ensure that it can finish an entire run even when there are failures after parsing New
Related to Conversion Tools - Bug #6889: rollback the files as 'unconverted' if (incremental) conversion fails. Test

History

#1 Updated by Constantin Asofiei about 3 years ago

This is from #7199-25:

Greg Shah wrote:

Constantin Asofiei wrote:

Greg, there is a simple change in Pattern.processAst - enclose it in a try/catch(Throwable) block, and I think this will not abend the conversion in case of FWD bugs.

I think we need to remove that AST from subsequent conversion steps otherwise it will be a real mess. And when we remove that AST, if it is a class/interface/enum there may be many other dependencies which would break. For this reason, I think the problem is bigger.

#2 Updated by Constantin Asofiei about 3 years ago

Currently, in case of FWD bugs in TRPL rules, FWD can abend and terminate the conversion. For very large code-sets, this is time-expensive as it hides any failures in files which would be processed after this 'first abend'. We need a way to:
  • prevent the conversion to abend - this is the Pattern.processAst enclosed in a try/catch proposal
  • log any relevant info about the file which abended and why, and collect this file name
  • on conversion finish, report the files which abended and terminate with a non-zero exit code.

Regarding this note:

Greg Shah wrote:

I think we need to remove that AST from subsequent conversion steps otherwise it will be a real mess. And when we remove that AST, if it is a class/interface/enum there may be many other dependencies which would break. For this reason, I think the problem is bigger.

I don't necessarily agree that we should remove the AST from the conversion. I agree that if a file fails i.e. during annotation, it will almost certainly fail on core code conversion, too. And it may bring other files to fail, like when a .cls fails and dependent files fail, or shared temp-tables/frames.

We already know that the conversion is in a 'failed' state when we encounter a failed file. But, leaving it in the conversion file list, and all its dependencies, FWD will report these, which will allow us to i.e. convert all these failed files separately (to test the fixes) until we try a full run again.

This may need to work in conjunction with #6082 to automatically pull all .cls files into conversion (but this can be solved manually by running parse first, get all the pre-scanned .cls, add them to the file-cvt-list.txt and run conversion again).

#3 Updated by Greg Shah about 3 years ago

  • Related to Feature #7179: rework the conversion process to ensure that it can finish an entire run even when there are failures after parsing added

#4 Updated by Greg Shah about 3 years ago

This is really a duplicate of #7179.

I agree that if a file fails i.e. during annotation, it will almost certainly fail on core code conversion, too. And it may bring other files to fail, like when a .cls fails and dependent files fail, or shared temp-tables/frames.

Which will create a large amount of unnecessary noise in the output. People may look at the later problems and miss the earlier root cause. The result of that will be wasted time. Generally, I don't see any value in failures that are downstream of the root cause. They aren't real failures. Reporting them is a net negative.

But, leaving it in the conversion file list, and all its dependencies, FWD will report these, which will allow us to i.e. convert all these failed files separately (to test the fixes) until we try a full run again.

This is not a reason to leave them in. We can just output the list of removed files at the time we remove them, so that it is clear what needs to be re-run.

#5 Updated by Greg Shah about 3 years ago

  • Subject changed from prevent abent during conversion in case of failures when processing TRPL rules to prevent abend during conversion in case of failures when processing TRPL rules

#6 Updated by Dănuț Filimon 8 months ago

  • Assignee set to Dănuț Filimon

#7 Updated by Dănuț Filimon 8 months ago

  • Related to Bug #6889: rollback the files as 'unconverted' if (incremental) conversion fails. added

#8 Updated by Constantin Asofiei 8 months ago

Danut, please see some changes from 9457c: bzr status -r 16245..16270 - there are either some commented code or abends replaced with logging:

  src/com/goldencode/ast/AnnotatedAst.java
  src/com/goldencode/p2j/pattern/CommonAstSupport.java
  src/com/goldencode/p2j/pattern/PatternEngine.java
  src/com/goldencode/p2j/uast/ClassDefinition.java

#9 Updated by Dănuț Filimon 8 months ago

Constantin Asofiei wrote:

Danut, please see some changes from 9457c: bzr status -r 16245..16270 - there are either some commented code or abends replaced with logging:
[...]

src/com/goldencode/p2j/pattern/PatternEngine.java changes look similar to what I've done in #6889, but seem incomplete.

#10 Updated by Dănuț Filimon 8 months ago

#6889 only has the changes for incremental conversion, making this available for all conversions is easy as it only requires moving allFailedSources outside the job.incremental check.

#11 Updated by Dănuț Filimon 3 months ago

  • Status changed from New to Review
  • % Done changed from 0 to 100
  • reviewer Greg Shah added

I addressed the concern about disabling the feature where errors do not stop the conversion from running, but only remove those sources from the source list. The new option I added is -R and can be used to enable it.

This will happen for both incremental and normal conversions.

Committed 7318a/16522 - 16523 (the branch was rebased, 16523 only contains fixes for the rebase mistakes I made).

Greg, please review.

#12 Updated by Greg Shah 3 months ago

  • Status changed from Review to Internal Test

Code Review Task Branch 7318a Revisions 16522 and 16523

I'm OK with the changes.

#14 Updated by Dănuț Filimon 2 months ago

  • Status changed from Internal Test to Merge Pending

Testing passed, 7318a can be merged after trunk is no longer frozen.

#15 Updated by Alexandru Lungu 2 months ago

Please merge 7318a to trunk after 11049a.

#16 Updated by Dănuț Filimon 2 months ago

  • Status changed from Merge Pending to Test
  • version_resolved set to trunk/16567

Branch 7318a was merged to trunk/16567 and then was archived.

Also available in: Atom PDF