You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@fineract.apache.org by "galovics (via GitHub)" <gi...@apache.org> on 2026/10/13 14:54:04 UTC

[PR] FINERACT-2925: Catch up COB after a replayed run and keep the date and COB jobs in order [fineract]

galovics opened a new pull request, #6640:
URL: https://github.com/apache/fineract/pull/6640

   ## Description
   
   Describe the changes made and why they were made. (Ignore if these details are present on the associated Apache Fineract JIRA ticket.)
   
   ## Checklist
   
   Please make sure these boxes are checked before submitting your pull request - thanks!
   
   - [ ] Write the commit message as per [our guidelines](https://github.com/apache/fineract/blob/develop/CONTRIBUTING.md#pull-requests)
   - [ ] 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.
   - [ ] Create/update [unit or integration tests](https://fineract.apache.org/docs/current/#_testing) for verifying the changes made.
   - [ ] 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
   - [ ] [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).
   - [ ] If merging this PR resolves a JIRA issue, I will mark that issue as resolved and set "Fix Version/s" appropriately.
   - [ ] I followed the [AI Policy](https://github.com/apache/fineract/blob/develop/CONTRIBUTING.md#ai-policy).
   
   Your assigned reviewer(s) will follow our [guidelines for code reviews](https://cwiki.apache.org/confluence/display/FINERACT/Code+Review+Guide).
   


-- 
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: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-2925: Catch up COB after a replayed run and keep the date and COB jobs in order [fineract]

Posted by "galovics (via GitHub)" <gi...@apache.org>.
galovics commented on PR #6640:
URL: https://github.com/apache/fineract/pull/6640#issuecomment-6191810784

   You are right, and my description was wrong. Thanks for catching it.
   
   Verified against the code:
   - `AbstractJob.execute` (Spring Batch 6.0.4, checked in the bytecode) does `setEndTime` -> `jobRepository.update(execution)` -> `afterJob`. The final status is persisted before the listener runs.
   - The catch-up days run one after another through `jobStarter.run` -> `jobOperator.start` (synchronous), so between two days no row is STARTED and `isCatchUpRunning()` is false.
   - Net effect: an N-day catch-up unlocked the hard-locked loans and queued another catch-up at the end of every day. A loan that keeps failing would make that a loop, as you describe; I reproduced the per-day repeat below but did not run the unbounded loop.
   
   Reproduced before the fix: a test that runs the listener for 3 catch-up days with `isCatchUpRunning()` false failed with `executeLoanCOBCatchUp()` invoked 3 times (once per day).
   
   Fix (as you suggested): `afterJob` returns early when the run's execution context has `IS_CATCH_UP=true`. I added `CatchUpFlagResolver.resolve(JobExecution)` and the existing `StepExecution` variant delegates to it, so the listener and the partitioner read the same value. A regular run has no such value (false) and still starts the catch-up.
   
   Tests: `startsNothingAtTheEndOfACatchUpRun` (3 days, `isCatchUpRunning()` false, nothing started and nothing unlocked) and `startsCatchUpAfterARegularRunWhoseCatchUpFlagIsFalse`, both for Loan COB and Working Capital COB. `*cob*`, `*jobs*`, spotless and checkstyle pass.
   
   Docs: batch-jobs.adoc, the listener javadoc and the commit message no longer claim the row is still STARTED.
   
   Also rebased onto current develop; the Liquibase changelog part is now `0259_...` because `0258` was taken.
   


-- 
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: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-2925: Catch up COB after a replayed run and keep the date and COB jobs in order [fineract]

Posted by "galovics (via GitHub)" <gi...@apache.org>.
galovics merged PR #6640:
URL: https://github.com/apache/fineract/pull/6640


-- 
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: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org