Skip to content

FINERACT-2621: Retry business date increase on concurrent initialization race - #6176

Open
avivijay19 wants to merge 1 commit into
apache:developfrom
avivijay19:FINERACT-2621/business-date-init-race
Open

FINERACT-2621: Retry business date increase on concurrent initialization race#6176
avivijay19 wants to merge 1 commit into
apache:developfrom
avivijay19:FINERACT-2621/business-date-init-race

Conversation

@avivijay19

Copy link
Copy Markdown
Contributor

Description

Extracted from #6069, where review asked for this to be raised in a separate PR since it is a pre-existing race, not something introduced by the Spring Boot upgrade.

INCREASE_BUSINESS_DATE_BY_1_DAY and INCREASE_COB_DATE_BY_1_DAY can run at the same time, and when m_business_date has no row for a type yet, both jobs insert the initial row and one of them fails on a duplicate key. This surfaced as a SchedulerJobsTest failure on a MySQL CI shard of #6069.

increaseDateByTypeByOneDay now runs in a transaction of its own, and the tasklets retry once when the first attempt is rolled back by the concurrent job.

Checklist

Please make sure these boxes are checked before submitting your pull request - thanks!

  • Write the commit message as per our guidelines
  • 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 for verifying the changes made.
  • Follow our 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". Large changes can be made in a branch, with assistance. Ask for help on the developer mailing list.

Your assigned reviewer(s) will follow our guidelines for code reviews.

…ion race

INCREASE_BUSINESS_DATE_BY_1_DAY and INCREASE_COB_DATE_BY_1_DAY can run at
the same time and both insert the initial m_business_date row, so one of
them fails on a duplicate key. Run each increase in its own transaction
and retry once when the first attempt is rolled back.
@AshharAhmadKhan

Copy link
Copy Markdown
Contributor

@avivijay19 please check the failing log.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants