You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@fineract.apache.org by "Mihaly Dallos (Jira)" <ji...@apache.org> on 2023/04/04 16:23:00 UTC

[jira] [Updated] (FINERACT-1909) Retry feature for commands - deadlock

     [ https://issues.apache.org/jira/browse/FINERACT-1909?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mihaly Dallos updated FINERACT-1909:
------------------------------------
    Labels: BeanSalad  (was: )

> Retry feature for commands - deadlock
> -------------------------------------
>
>                 Key: FINERACT-1909
>                 URL: https://issues.apache.org/jira/browse/FINERACT-1909
>             Project: Apache Fineract
>          Issue Type: Bug
>          Components: Savings
>         Environment: Local.
> ./gradlew clean
> ./gradlew :fineract-provider:jibDockerBuild -x test 
> docker compose up
>            Reporter: Peter Santa
>            Priority: Critical
>              Labels: BeanSalad
>         Attachments: Fineract_savings_deposit_retry_test-2x100.log, application.properties
>
>
> h1. Background
> In our use case, Savings Account transactions have to be inserted, sometimes multiple transactions for the same account triggered by independent threads.
> Tested on this commit hash: *{color:#000000}d21110f7b{color}*
> {color:#000000}application.properties modified to:{color}
> {{{color:#083080}resilience4j.retry.instances.executeCommand.max-attempts{color}={color:#067d17}${FINERACT_COMMAND_PROCESSING_RETRY_MAX_ATTEMPTS:20}{color}{color:#067d17}...{color}}}
> {{{color:#083080}resilience4j.retry.instances.executeCommand.retryExceptions{color}={color:#067d17}${FINERACT_COMMAND_PROCESSING_RETRY_EXCEPTIONS:org.springframework.dao.CannotAcquireLockException,org.springframework.orm.ObjectOptimisticLockingFailureException,org.eclipse.persistence.exceptions.OptimisticLockException}{color}}}
> h3. Build and run
> ./gradlew clean
> ./gradlew :fineract-provider:jibDockerBuild -x test 
> docker compose up
> h1. Phenomenon
> Performing the following command 100 times on 2 threads (sum: 200 deposit), by Postman runner:
> POST {{{}url{}}}{color:#212121}/savingsaccounts/{color}{{{}savingsAccountId{}}}{color:#212121}/transactions?command=deposit{color}
> {color:#000000}{{color}
> {color:#000000} {color}{color:#a31515}"transactionDate"{color}{color:#000000}: {color}{color:#f26b3a}{ \\{currentDate}}{color}{color:#000000},{color}
> {color:#000000} {color}{color:#a31515}"transactionAmount"{color}{color:#000000}: {color}{color:#098658}1000{color}{color:#000000},{color}
> {color:#000000} {color}{color:#a31515}"paymentTypeId"{color}{color:#000000}: {color}{color:#f26b3a}{ \\{paymentTypeId}}{color}{color:#000000},{color}
> {color:#000000} {color}{color:#a31515}"note"{color}{color:#000000}: {color}{color:#0451a5}""{color}{color:#000000},{color}
> {color:#000000} {color}{color:#a31515}"dateFormat"{color}{color:#000000}: {color}{color:#0451a5}"yyyyMMdd"{color}{color:#000000},{color}
> {color:#000000} {color}{color:#a31515}"locale"{color}{color:#000000}: {color}{color:#0451a5}"en"{color}
> {color:#000000}}
> h1. Expected result
> Fineract retries the command if any of the configured exception is thrown, and all the transactions are performed successfully.
> h1. Actual result
> Deadlock. See the logs attached.
> 2 commands were unsuccessful - internal server error, code 500 response on API.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)