XF 2.2 Deadlock on permission API

Hi,

we created a custom endpoint for forum permission and we are using the existing code from xenforo,

PHP:
$permissionUpdater = $this->service('XF:UpdatePermissions');
        $permissionUpdater->setContent('node', $forumId)->setUser($user);
        $permissionUpdater->updatePermissions($permissions);

we are calling this API from our system through the Kafka cluster. 3 instances are calling this API frequently because of this in the community system we are getting a deadlock error.

SQL:
INSERT  INTO xf_permission_combination_user_group (permission_combination_id, user_group_id) VALUES (47170,2)
*** (1) WAITING FOR THIS LOCK TO BE GRANTED:
RECORD LOCKS space id 288 page no 203 n bits 352 index permission_combination_id of table communit_xenforo.xf_permission_combination_user_group trx id 588AA681 lock_mode X insert intention waiting
Record lock
INSERT  INTO xf_permission_combination_user_group (permission_combination_id, user_group_id) VALUES (47169,2)
*** (2) HOLDS THE LOCK(S):

can you please help us with this to understand the issue?
 
Last edited:
BUMP. Any thoughts on this issue?

We are blocked for a long time now as we are unable to solve this issue and every moment we are experiencing "
  • src/XF/Repository/PermissionEntry.php:125
  • Generated by: Unknown account
  • Apr 22, 2022 at 6:57 AM

Stack trace​

#0 [internal function]: XF::handleFatalError()
#1 {main}

Request state​

array(4) {
["url"] => string(8) "/job.php"
["referrer"] => string(41) "https://community.simplilearn.com/forums/"
["_GET"] => array(0) {
}
["_POST"] => array(0) {
}
}
https://community.simplilearn.com/admin.php?logs/server-errors/2481649/delete
This we are getting at different instances as well. We tried increasing the size but its causing CPU spike up to 100%. Could you please help us?
 
Top Bottom