pwargulak opened a new pull request, #6746: URL: https://github.com/apache/fineract/pull/6746
## Description [FINERACT-3000](https://issues.apache.org/jira/browse/FINERACT-3000) The Working Capital loan COB worker step built its reader, processor and writer once, so every partition of the job shared them. Partitions of one job can run at the same time on one instance; when they did, the second partition's `beforeStep` replaced the first one's loan queue, and the first partition's loans stayed locked without being processed while the job ended `COMPLETED`. This change: - makes the reader, processor and writer `@StepScope` beans, as `LoanCOBWorkerConfiguration` does, and passes them to the step; - has `WorkingCapitalLoanCOBWorkerItemReader` implement `StepExecutionListener` instead of carrying `@BeforeStep`: the step-scope proxy is a subclass that does not carry the annotation, and the interface form is the one `CobStepListenerRegistrationTest` pins. Tests: - new `WorkingCapitalLoanCOBWorkerScopeTest` (2): two step executions active at once each read their own loans, and each gets its own reader, processor and writer. Both fail on `develop`; - `CobStepListenerRegistrationTest` covers the four WC item components; the worker reader case fails on `develop`; - new `FeignWorkingCapitalLoanCobPartitionsTest`: one scheduled run over 102 loans (two partitions) closes every loan. It can pass on `develop` too, since the overlap depends on timing. Run locally: on the three changes together (FINERACT-3000, 3001, 3002) on develop 537e19aaa9: spotless, checkstyle, rat, javadoc, spotbugs and the Liquibase DDL safety check are clean; the core build; the unit suites of `fineract-provider` (1899 tests), `fineract-working-capital-loan` (1721) and `fineract-cob` (5), no failures; and all 76 Working Capital and COB integration test classes (748 tests) on PostgreSQL, MariaDB and MySQL, where the five indexes were checked to exist. Not run: the other integration test classes and the e2e (Cucumber) suite. ## Checklist - [x] Write the commit message as per [our guidelines](https://github.com/apache/fineract/blob/develop/CONTRIBUTING.md#pull-requests) - [x] Acknowledge that we will not review PRs that are not passing the build _("green")_ - it is your responsibility to get a proposed PR to pass the build, not primarily the project's maintainers. - [x] Create/update [unit or integration tests](https://fineract.apache.org/docs/current/#_testing) for verifying the changes made. - [x] Follow our [coding conventions](https://cwiki.apache.org/confluence/display/FINERACT/Coding+Conventions). - [ ] Add required Swagger annotation and update API documentation at fineract-provider/src/main/resources/static/legacy-docs/apiLive.htm with details of any API changes - [x] [This PR must not be a "code dump"](https://cwiki.apache.org/confluence/display/FINERACT/Pull+Request+Size+Limit). Large changes can be made in a branch, with assistance. Ask for help on the [developer mailing list](https://fineract.apache.org/#contribute). - [x] If merging this PR resolves a JIRA issue, I will mark that issue as resolved and set "Fix Version/s" appropriately. - [x] I followed the [AI Policy](https://github.com/apache/fineract/blob/develop/CONTRIBUTING.md#ai-policy). -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
