Project

General

Profile

Actions

Defect #1040

closed

Prevent to delete automatic role, when long running task is canceled

Added by Radek Tomiška about 6 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Immediate
Assignee:
Radek Tomiška
Category:
Roles
Target version:
Start date:
03/23/2018
Due date:
% Done:

100%

Estimated time:
Affected versions:
Owner:

Description

In version 7.8.4 was implemented optimalization for automatic roles - assigned roles are not added / deleted by roles requests, but directly. There is a bug in updated long running task for removing automatic role - when task is canceled before all assigned roles are removed, then automatic role is removed - referential integrity could be broken.

Actions #1

Updated by Radek Tomiška about 6 years ago

  • Status changed from In Progress to Needs feedback
  • Assignee changed from Radek Tomiška to Ondřej Kopr
  • % Done changed from 0 to 90

Problem was in long running task 'RemoveAutomaticRoleTaskExecutor', whre statefull task is used now and automatic role was removed, when task ends (cancel, or not).

This is in hotfix 7.8.5 and in develop. Prevent to cancel remove automatic roles task manually, before 7.8.5 version is used. Otherwise, update

delete from idm_identity_role where automatic_role_id is not null and automatic_role_id not in (select id from idm_auto_role);

has to be used.

Commit:
https://github.com/bcvsolutions/CzechIdMng/commit/126e42c8851ae01e4d5bc9bcc00cd3737f9719dd

Could you do a feedback, pls?

Actions #2

Updated by Ondřej Kopr about 6 years ago

  • Status changed from Needs feedback to Resolved
  • Assignee changed from Ondřej Kopr to Radek Tomiška
  • % Done changed from 90 to 100

I simulate this problem by create one role that assigned system with throw exception while deleting entity from system (add throw new exception into our code, method doDeleteProvisioning), your fix works awesome, this was potential referential integrity bug.

Thank you for fix the problem :) you are so awesome debug guy, you also tried unbelievable situations and this is very good for us.

Actions #3

Updated by Radek Tomiška about 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF