-
Bug
-
Resolution: Done
-
Major
-
None
-
None
-
None
-
False
-
None
-
False
-
Medium
-
-
---
-
---
-
2022 Week 38-40 (from Sept 19)
`PredictionCodegen` extends `AbstractGenerator` and override the method `internalGenerate` that creates "GeneratedFile"s out of `PMMLResources` and `IndexFiles`.
The issue is that `resources` and `indexFiles` are populated by statically by `PredictionCodegen.ofCollectedResources` that, at one point, has to delete the previously created `IndexFiles` to avoid mixing of different builds.
The result is that, inside a multithread environment, those files get deleted by one thread while are accessed on another one, raising the exception:
`19:02:44 [ERROR] [error]: Build step org.kie.kogito.quarkus.common.deployment.KogitoAssetsProcessor#generateSources threw an exception: org.kie.pmml.api.exceptions.KiePMMLException: Failed to read content of (/....)/target/IndexFile.pmml_json`.
Removing the `deleteIndexFiles();` invocation at line 107 does not works because, in that case, all the different models gets merged in one single file (`PredictionCodegenTest.generateAllFiles*` tests fails).
The solution should be to move the code generation part (both resources and indexfile) inside the `PredictionCodegen` instance.
As side note, it would be better to create an utility class with all the static methods, separated from the `PredictionCodegen` that should contain only instance methods.
- relates to
-
DROOLS-7174 Split efesto-common-api to efesto-common-core
- Resolved