Adam Saghy created FINERACT-2798:
------------------------------------

             Summary: Review and fix re-entrant recording window issue for Bulk 
business event
                 Key: FINERACT-2798
                 URL: https://issues.apache.org/jira/browse/FINERACT-2798
             Project: Apache Fineract
          Issue Type: Bug
    Affects Versions: 1.15.0
            Reporter: Arnold Galovics
            Assignee: Adam Saghy
             Fix For: 1.16.0


 \{*}Non-reentrant recording window for Bulk business events 
({*}WorkingCapitalLoanAdjustTransactionEventPublisher#publishReprocessed{*}){*}
{code:java}
businessEventNotifierService.startExternalEventRecording();
adjustments.forEach(... notifyPostBusinessEvent ...);
businessEventNotifierService.stopExternalEventRecording();
{code}
 

eventRecordingEnabled is a plain ThreadLocal<Boolean>, not a counter, so this 
doesn't nest. COBBusinessStepServiceImpl.run() already opens a recording window 
around the whole business step chain when bulk events are enabled. If WC 
transaction reprocessing is ever reached from inside a COB step, the inner 
stopExternalEventRecording() flushes and closes COB's window mid-chain - 
premature bulk event, and nothing recorded afterwards. Latent today (only 
command paths call reprocessing), but worth guarding or making the window 
reentrant centrally - ReplayedTransactionBusinessEventServiceImpl in 
fineract-loan has the same shape, so this may be worth fixing once for both.



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

Reply via email to