Bug #6889
rollback the files as 'unconverted' if (incremental) conversion fails.
100%
Related issues
History
#1 Updated by Constantin Asofiei over 3 years ago
When incremental conversion is ran, once the parse phase finishes, a file is marked 'converted'. But, incremental conversion may fail further in the conversion process - FWD should rollback the state of the files as 'unconverted', so they can be picked up again in the next incremental conversion run.
#2 Updated by Dănuț Filimon 8 months ago
- Status changed from New to WIP
- Assignee set to Dănuț Filimon
#3 Updated by Dănuț Filimon 8 months ago
If incremental conversion fails during the Scanning Progress Source (preprocessor, lexer, parser, persist ASTs) phase, it will not be marked as "converted" and will be picked up when running incremental conversion again.
#4 Updated by Dănuț Filimon 8 months ago
For the rest of the incremental conversion process, I though of letting the PatternEngine.run() throw and catch errors for each individual processAst() call, add those files to a set and have them eventually removed from the sources for the following phases. I got the first part done and it looks promising, but I need to let the PatternEngine know if I am running incremental or not.
#5 Updated by Dănuț Filimon 8 months ago
- Status changed from WIP to Review
- % Done changed from 0 to 100
- reviewer Greg Shah added
Committed 6889a/16267. Rollback source files that failed processing during incremental conversion.
Greg, please review.
Creating a centralized error manager for the conversion process is something I will have to think through in another task (the one you mentioned in our meeting).
#6 Updated by Dănuț Filimon 8 months ago
- Related to Feature #7318: prevent abend during conversion in case of failures when processing TRPL rules added
#7 Updated by Dănuț Filimon 8 months 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
#8 Updated by Dănuț Filimon 8 months ago
- Related to Feature #1772: rework all conversion tools to use database-backed/centralized tracing/logging/error management added
#9 Updated by Dănuț Filimon 8 months ago
- Considering #7318/#7179, should we remove files from conversion even if we are not running incremental conversion? If there are sources that failed to be converted, incremental conversion can be run after that.
- What should happen if global init/post rules fail in PatternEngine.run() and not processAst? This is for #1772, there is no specific file for this that can be used as reference for a possible conversion error manager.
#10 Updated by Dănuț Filimon 8 months ago
Committed a null check in 6889a/16268.
#11 Updated by Greg Shah 8 months ago
Code Review Task Branch 6889a Revisions 16267 and 16268
1. Shouldn't cleanSources() be called at the end of processTrees() instead of in some of the callers? It seems like it should be called every time and it can be done in just 2 places instead of exploded out everywhere. Also, as part of this, I don't see why we need the failedSources set to be a data member. It can just be local data in processTrees(). That would simplify the changes.
2. The catch (Throwable thr) appears 3 times in the 2 PatternEngine.run() methods. That code seems pretty duplicative. Can you condense that down into a common worker method?
3. Didn't we see a regression recently with the code changed in FileList.removeFiles()? Perhaps I am misremembering.
#12 Updated by Dănuț Filimon 8 months ago
Greg Shah wrote:
Code Review Task Branch 6889a Revisions 16267 and 16268
1. Shouldn't
cleanSources()be called at the end ofprocessTrees()instead of in some of the callers? It seems like it should be called every time and it can be done in just 2 places instead of exploded out everywhere. Also, as part of this, I don't see why we need thefailedSourcesset to be a data member. It can just be local data inprocessTrees(). That would simplify the changes.
processTrees() is static, so I would be required to pass the TransformDriver instance as a parameter to this call or pass the original sources. There's also the option of creating another method to call it (I actually think this is better).
2. The
catch (Throwable thr)appears 3 times in the 2PatternEngine.run()methods. That code seems pretty duplicative. Can you condense that down into a common worker method?
I will check and create a separate method.
3. Didn't we see a regression recently with the code changed in
FileList.removeFiles()? Perhaps I am misremembering.
I searched for FileList.removeFiles() in other issues and did not find any mention of it.
#13 Updated by Dănuț Filimon 8 months ago
- Status changed from Review to WIP
- % Done changed from 100 to 80
#14 Updated by Dănuț Filimon 8 months ago
- Status changed from WIP to Review
- % Done changed from 80 to 100
I addressed the review from #6889-11 in 6889a/16269.
Greg, please review.
#16 Updated by Dănuț Filimon 8 months ago
- Status changed from Review to Internal Test
Greg Shah wrote:
Code Review Task Branch 6889a Revision 16269
Literals like
".ast",".p2o",".jast",".dict"should beAstGeneratorconstants. Otherwise the changes are very nice.
I committed this change to 6889a/16270, the rest will be taken care of in 7180a which adds FileExtensions.
#17 Updated by Dănuț Filimon 7 months ago
Regression tests passed, I am rebasing to check for conflicts.
#18 Updated by Dănuț Filimon 7 months ago
Rebased 6889a to latest trunk/16312, the branch is now at revision 16316.
6889a can be merged.
#20 Updated by Alexandru Lungu 7 months ago
- Status changed from Internal Test to Merge Pending
Please merge 6889a to trunk after 7851a.
#21 Updated by Dănuț Filimon 7 months ago
- version_resolved set to trunk/16318
- Status changed from Merge Pending to Test
Branch 6889a was merged into trunk as rev. 16318 and archived.