Project

General

Profile

Actions

Defect #1500

closed

When HR process is stopped manually, its next run processes wrong items

Added by Alena Peterová about 5 years ago. Updated almost 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Radek Tomiška
Category:
Long running task
Target version:
Start date:
02/12/2019
Due date:
% Done:

100%

Estimated time:
Affected versions:
Owner:

Description

Version 9.3.4.

This was tested in an environment with 865 contracts.

Steps to reproduce:
  • Run the scheduled task HrEnableContractProcess - it processes 0/0 (to be sure that all contracts were already processed in the past)
  • Run the task HrEnableContractProcess again and stop the task during execution by Scheduled Task -> Running tasks -> End task (or Terminate task). The task is canceled in the middle of computing items to process, e.g. 458 are left.
  • Run the task HrEnableContractProcess again. It processes all 458 items which weren't computed before. But these items shouldn't be processed again, because they were processed in the past.

Please see the screenshot to better understand.

The problem is, if there is some notification attached to contract enabling (in our case we extend HrEnableContractProcess to notify managers of the new contracts), then this notification will be sent again for all the 458 contracts.

Interestingly, if we shutdown the application server during running of the task, the problem doesn't appear.


Files

hr_process_manual_stop.png (27.5 KB) hr_process_manual_stop.png Alena Peterová, 02/12/2019 03:22 PM
Actions #1

Updated by Radek Tomiška about 5 years ago

  • Status changed from New to In Progress
  • Target version set to Quartz (9.6.0)
Actions #2

Updated by Radek Tomiška almost 5 years ago

  • Status changed from In Progress to Needs feedback
  • Assignee changed from Radek Tomiška to Vít Švanda
  • % Done changed from 0 to 90

I've fixed clearing processed item queue - queue is cleared only, if task ends correctly. The same issue was with adding processed item into queue - only correctly processed item is added into queue now - so if the item processing fails, then item will be processed again in next task run.

Commit:
https://github.com/bcvsolutions/CzechIdMng/commit/1b10220586fd7d33dba6ec36f76f04302f6be246

Doc:
https://wiki.czechidm.com/devel/documentation/application_configuration/dev/scheduled_tasks/task-scheduler#stateful_task_executors

Could you do a feedback, please?

Actions #3

Updated by Vít Švanda almost 5 years ago

  • Status changed from Needs feedback to Resolved
  • Assignee changed from Vít Švanda to Radek Tomiška
  • % Done changed from 90 to 100

I reviewed it. It works logically and nicely. Thanks for that.

Actions #4

Updated by Radek Tomiška almost 5 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF