AI Search
Classic Search
 Search Phrase:
 Search Type:
Advanced search options
 Search in Forums:
 Search in date period:

 Sort Search Results by:

AI Assistant
Notifications
Clear all

[Closed] WPFORO creating deadlocks in MySQL

3 Posts
2 Users
0 Reactions
1,004 Views
Posts: 2
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@wcgtech)
New Member
Joined: 3 years ago
[#50410]

Does anyone have any experience with wpforo creating DB deadlocks?  Specifically I'm running into it deadlocking on the wpforo_phrases table.

Its trying to run an INSERT IGNORE, I get the error 'Waiting for table level lock' and then it continues to run, quickly filling up DB connections.  I have no other code interacting with the wpforo_phrases table, just the plugin.  I do have the polls addon, no other addons. 

Any insight would be awesome.  I've repaired and recreated the table.  It seems to happen at random times , but once the first deadlock occurs, it spirals quickly.

It is not frequent and I can usually solve be completely stopping and starting my DB server, but thats far from ideal

 


2 Replies
Posts: 2
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@wcgtech)
New Member
Joined: 3 years ago

If it helps - I've isolated it to this section of code in the Phrases.php file.

if( $langid ) {
	foreach( $vals as $val ) {
		if( isset( $val['tag'] ) && $val['tag'] == 'PHRASE' && isset( $val['attributes']['NAME'] ) && trim( (string) $val['attributes']['NAME'] ) && isset( $val['value'] ) && trim( (string) $val['value'] ) ) {
			$sql = "INSERT IGNORE INTO `" . WPF()->tables->phrases . "` 
					(`phraseid`, `langid`, `phrase_key`, `phrase_value`)
					VALUES( NULL, 
							'" . intval( $langid ) . "', 
						 '" . esc_sql( stripslashes( htmlspecialchars_decode( (string) $val['attributes']['NAME'], ENT_QUOTES ) ) ) . "', 
							'" . esc_sql( stripslashes( htmlspecialchars_decode( (string) $val['value'], ENT_QUOTES ) ) ) . "')";
			WPF()->db->query( $sql );
		}
	}
	return $langid;
}

 

dimalifragis
Posts: 2600
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@dimalifragis)
Famed Member
Joined: 6 years ago

Nobody has reported something like this. Usually it is some plugin, hard to find. Very hard. I had one issue like that and since it happened once in a while, it was impossible to find the cause.

Luckily someone reported also the same with a plugin i used and after removing it, the issue is gone.

Also is your DB engine version updated?


Share: