Deadlocks caused by this addon

nocte

Member
Reactions
5
Hi @Xon,

I have a high traffic forum and I have several times a day deadlock errors in my error log because of this part in your addon:

PHP:
        // need some locking to avoid wonky race conditions
        $db->query('select user_id from xf_user for update');

(Class::method: SV\SignupAbuseBlocking\Repository\MultipleAccount::processMultipleAccountDetectionInternal())

The queries in my error log are always one of these two:

SQL:
UPDATE  `xf_user` SET `conversations_unread` = ? WHERE `user_id` = 123
SQL:
                UPDATE xf_user
                SET alerts_unread = GREATEST(0, CAST(alerts_unread AS SIGNED) - ?)
                WHERE user_id = ?

Can we do anything against that? 🤔
 

Users who are viewing this thread

Back
Top