[ 
https://issues.apache.org/jira/browse/FINERACT-2918?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18129517#comment-18129517
 ] 

Shubham Chaudhary commented on FINERACT-2918:
---------------------------------------------

Hi [~adamsaghy] ,

I noticed that Mr. [~arnold]Β  has opened several issues, and I wanted to check 
whether he plans to work on all of them himself or if some of them are 
available for others to pick up.

I’ve already asked about a few of them in the comments but haven’t received a 
response yet. I’d be happy to take ownership of some issues and contribute to 
getting them resolved.

Please let me know if there are any I can work on.

> Scheduler resume replays misfired jobs asynchronously, then saves a future 
> next_run_time, so the replay vetoes itself
> ---------------------------------------------------------------------------------------------------------------------
>
>                 Key: FINERACT-2918
>                 URL: https://issues.apache.org/jira/browse/FINERACT-2918
>             Project: Apache Fineract
>          Issue Type: Bug
>            Reporter: Arnold Galovics
>            Assignee: Arnold Galovics
>            Priority: Major
>
> πŸ“‹ JIRA Bug Preview 1/5
> ─────────────────────────────────────
> Project: Β  FINERACT - Apache Fineract
> Type: Β  Β  Β Bug
> Summary: Β  Scheduler resume replays misfired jobs asynchronously, then saves 
> a future next_run_time, so the replay vetoes itself
> πŸ› Steps to Reproduce
> Β  1. Fineract 1.15.0 (or develop), scheduler_detail.execute_misfired_jobs = 
> true (the default).
> Β  2. Give an active job a 1-minute cron (e.g. Update Loan Arrears Ageing).
> Β  3. POST /scheduler?command=stop.
> Β  4. Wait for a few cron fires, so the job has is_misfired = true.
> Β  5. POST /scheduler?command=start.
> Β  6. Check the job run history and the next_run_time / is_misfired columns of 
> the job.
> ❌ Actual Result
> Β  β€’ The replay is vetoed and the job does not run (ran in 1 of 13 attempts on 
> 1.15.0).
> Β  β€’ is_misfired is cleared anyway, so the record of the missed run is lost.
> βœ… Expected Result
> Β  β€’ Each misfired active job runs once on resume, then is_misfired is cleared.
> ℹ️ Notes
> Β  β€’ Reproduced on 1.15.0 (bootJar, Postgres). The vetoer read next_run_time 
> about 0.6 s after it was saved.
> πŸ”§ Technical Notes
> Β  β€’ JobRegisterServiceImpl#startScheduler: executeJob(..., TRIGGER_TYPE_CRON) 
> (:175) only queues the fire via scheduler.triggerJob (:122). The same thread 
> then sets jobDetail.setNextRunTime(trigger.getNextFireTime()) (:187) and 
> saves it.
> Β  β€’ 
> SchedularWritePlatformServiceJpaRepositoryImpl#processJobDetailForExecution 
> (:146-150) vetoes a CRON-type fire when getNextRunTime().after(new Date()).
> Β  β€’ Fix idea: do not advance next_run_time before the replay has claimed the 
> job, or replay with a trigger type that is not compared against next_run_time.
> ─────────────────────────────────────



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

Reply via email to