adamsaghy commented on code in PR #3944:
URL: https://github.com/apache/fineract/pull/3944#discussion_r1651054187
##########
fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/service/StuckJobExecutorServiceImpl.java:
##########
@@ -39,14 +47,20 @@ public class StuckJobExecutorServiceImpl implements
StuckJobExecutorService {
private final JobExecutionRepository jobExecutionRepository;
private final TransactionTemplate transactionTemplate;
private final JobOperator jobOperator;
+ private final JobExplorer jobExplorer;
+ private final JobRepository jobRepository;
@Override
public void resumeStuckJob(String jobName) {
- List<Long> stuckJobIds = getStuckJobIds(jobName);
- if (isPartitionedJob(jobName) && areThereStuckJobs(jobName)) {
- restartPartitionedJobs(jobName, stuckJobIds);
- } else {
- restartTaskletJobs(stuckJobIds);
+ if (areThereStuckJobs(jobName)) {
+ final List<Long> stuckJobIds = getStuckJobIds(jobName);
+ stuckJobIds.forEach(stuckJobId -> markAsFailed(stuckJobId));
Review Comment:
The original handling was correct, but there was a "flaw":
It got stuck forever if it is waiting on its own batch step to finish:
Example:
- Job got started on the Batch manager (Loan COB)
- Batch manager starts the "Loan COB partition - Step" (in DB it status
goes to STARTING or STARTED), but it got interrupted and batch manager got
restarted.
- When the batch manager restarted it check is there any "running" batch
step and will find the "Loan COB partition - Step" and it starts waiting till
it got completed (which never happens hence the batch manager was restarted).
**Solution**
if the batch manager was restarted and one of the batch step that is belong
to the Manager (batch manager started that batch step!) is in STARTING /
STARTED, mark it as failed and do not wait till got finished (which never
happens)
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]