XF 1 Fix deadlock in conversations

grisha2217

Active member
This happens when user trying send two or more messages in short time (like 2 messages in 1 second)
XenForo 1.5.24
Reward: 50$

Zend_Db_Statement_Mysqli_Exception: Mysqli statement execute error : Deadlock found when trying to get lock; try restarting transaction - library/Zend/Db/Statement/Mysqli.php:214
Generated By: user, 2 minutes ago


#0 library/Zend/Db/Statement.php(297): Zend_Db_Statement_Mysqli->_execute(Array)
#1 library/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Statement->execute(Array)
#2 library/Lolzteam/Im/XenForo/Model/Conversation.php(76): Zend_Db_Adapter_Abstract->query('
UPDATE xf_conversation_user SET
is_unread = 1,
reply_count = 12,
last_message_date = 1638887861,
last_message_id = 44158937,
last_message_user_id = 4774808,
last_message_username = 'f0rZe'
WHERE conversation_id = ?
AND owner_user_id = ?
', Array)
#3 library/XenForo/DataWriter/ConversationMaster.php(357): Lolzteam_Im_XenForo_Model_Conversation->addConversationReplyToRecipients(Array, Array, Array)
#4 library/XenForo/DataWriter.php(1431): XenForo_DataWriter_ConversationMaster->_postSave()
#5 library/SV/DeadlockAvoidance/XenForo/DataWriter/ConversationMaster.php(11): XenForo_DataWriter->save()
#6 library/XenForo/DataWriter/ConversationMessage.php(187): SV_DeadlockAvoidance_XenForo_DataWriter_ConversationMaster->save()
#7 library/XenForo/DataWriter.php(1431): XenForo_DataWriter_ConversationMessage->_postSave()
#8 library/SV/DeadlockAvoidance/XenForo/DataWriter/ConversationMessage.php(11): XenForo_DataWriter->save()
#9 library/XenForo/ControllerPublic/Conversation.php(1552): SV_DeadlockAvoidance_XenForo_DataWriter_ConversationMessage->save()
#10 library/SV/AlertImprovements/XenForo/ControllerPublic/Conversation.php(25): XenForo_ControllerPublic_Conversation->actionInsertReply()

array(3) {
["url"] => string(53) "conversations/13176104/insert-reply"
["_GET"] => array(1) {
["/conversations/13176104/insert-reply"] => string(0) ""
}
["_POST"] => array(9) {
["message_html"] => string(43) "Test message"
["_xfRelativeResolver"] => string(41) "conversations/13176104/"
["reply_message_ids"] => string(0) ""
["_xfToken"] => string(8) "********"
["tab_id"] => string(6) "894583"
["messageTime"] => string(13) "1638887860648"
["_xfRequestUri"] => string(24) "/conversations/13176104/"
["_xfNoRedirect"] => string(1) "1"
["_xfResponseType"] => string(4) "json"
}
}
 

Xon

Well-known member
Don't give out the 'bypass flood check' permission and ensure the flood check is at last 1 seconded as otherwise you'll run into all sorts of issues with XenForo 1.x. This permission is a footgun, don't use it.

Then try this old add-on;

:edit: looks like you had this issue for a while. That add-on might not help then.
 

grisha2217

Active member
Don't give out the 'bypass flood check' permission and ensure the flood check is at last 1 seconded as otherwise you'll run into all sorts of issues with XenForo 1.x. This permission is a footgun, don't use it.

Then try this old add-on;

:edit: looks like you had this issue for a while. That add-on might not help then.
Yes, im already using your addon, but it doesn't affect my problem. Can you update this plugin? You will receive good reward from me
My telegram: @lolzteam_old
 

grisha2217

Active member
Don't give out the 'bypass flood check' permission and ensure the flood check is at last 1 seconded as otherwise you'll run into all sorts of issues with XenForo 1.x. This permission is a footgun, don't use it.

Then try this old add-on;

:edit: looks like you had this issue for a while. That add-on might not help then.
Maybe 100$ ?
 
Top