Project

General

Profile

Actions

Defect #3473

open

Error when two processes save the same IdmConceptRoleRequest

Added by Vladimír Kotýnek about 1 year ago. Updated about 1 year ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Roles
Target version:
-
Start date:
11/03/2023
Due date:
% Done:

0%

Estimated time:
Affected versions:
Owner:

Description

When approval process and provisioning-operation-retry-bulk-action process try to update the same role request a deadlock can ocure.

Caused by: org.postgresql.util.PSQLException: ERROR: deadlock detected
  Detail: Process 26254 waits for ShareLock on transaction 904970719; blocked by process 29145.
Process 29145 waits for ShareLock on transaction 904970824; blocked by process 26254.
  Hint: See server log for query details.
  Where: while updating tuple (540994,2) in relation "idm_concept_role_request" 

Both processes were commiting their changes to DB blocked each other (this bellow is during/after application restart).
postgres=# select * from pg_stat_activity where pid = 29145;
 datid | datname  |  pid  | usesysid | usename  |    application_name    | client_addr  | client_hostname | client_port |         backend_start         | xact_start |          query_start          |      
   state_change          | wait_event_type | wait_event | state | backend_xid | backend_xmin | query  |  backend_type  
-------+----------+-------+----------+----------+------------------------+--------------+-----------------+-------------+-------------------------------+------------+-------------------------------+------
-------------------------+-----------------+------------+-------+-------------+--------------+--------+----------------
 16401 | czechidm | 29145 |    16384 | czechidm | PostgreSQL JDBC Driver | 10.14.144.79 |                 |       47158 | 2023-11-03 10:04:58.224087+01 |            | 2023-11-03 10:32:41.401508+01 | 2023-
11-03 10:32:41.401549+01 | Client          | ClientRead | idle  |             |              | COMMIT | client backend
(1 row)

postgres=# select * from pg_stat_activity where pid = 26254;
 datid | datname  |  pid  | usesysid | usename  |    application_name    | client_addr  | client_hostname | client_port |         backend_start         | xact_start |          query_start          |      
   state_change          | wait_event_type | wait_event | state | backend_xid | backend_xmin | query  |  backend_type  
-------+----------+-------+----------+----------+------------------------+--------------+-----------------+-------------+-------------------------------+------------+-------------------------------+------
-------------------------+-----------------+------------+-------+-------------+--------------+--------+----------------
 16401 | czechidm | 26254 |    16384 | czechidm | PostgreSQL JDBC Driver | 10.14.144.79 |                 |       45892 | 2023-11-03 09:58:17.807327+01 |            | 2023-11-03 10:26:58.046104+01 | 2023-
11-03 10:26:58.046144+01 | Client          | ClientRead | idle  |             |              | COMMIT | client backend
(1 row)

No data to display

Actions

Also available in: Atom PDF