Page 1 of 1

DB m_Query Lock crash

Posted: Sun Jul 26, 2015 1:29 pm
by John Adams
A new crash, looks like related to trying to write world_gametime update at the same time the world was trying to set my disconnected character to Toggle Offline

Code: Select all

 	WorldServer.exe!_net_write_packet()	Unknown
 	WorldServer.exe!_my_net_read()	Unknown
 	WorldServer.exe!_my_net_read()	Unknown
 	WorldServer.exe!_my_net_read()	Unknown
 	WorldServer.exe!_my_net_read()	Unknown
 	WorldServer.exe!_cli_safe_read()	Unknown
 	WorldServer.exe!_mysql_close@4()	Unknown
 	WorldServer.exe!_mysql_real_query@12()	Unknown
 	WorldServer.exe!Database::Query(const char * fmt, ...) Line 138	C++
>	WorldServer.exe!WorldDatabase::ToggleIsOnline(unsigned int char_id, bool toggle) Line 2713	C++
 	WorldServer.exe!UDPServer::BeginDisconnectFromServer(std::shared_ptr<Client> & client, unsigned short reason_id) Line 636	C++
 	WorldServer.exe!UDPServer::CheckTimeouts() Line 658	C++
 	WorldServer.exe!ReaderThread(void * data) Line 122	C++
 	WorldServer.exe!ThreadRun(void * arg) Line 77	C++
 	WorldServer.exe!_callthreadstart() Line 255	C
 	WorldServer.exe!_threadstart(void * ptd) Line 239	C
 	kernel32.dll!75d9336a()	Unknown
 	[Frames below may be incorrect and/or missing, no symbols loaded for kernel32.dll]	
 	ntdll.dll!776b92b2()	Unknown
 	ntdll.dll!776b9285()	Unknown
Console errors:
[quote]13:25:19.041 D Char Saved successful for character 'Testy McTester' (1)
13:26:14.796 D Char ToggleIsOnline: Setting player offline
13:26:14.935 D Char ToggleIsOnline: Setting player offline
13:26:24.797 E Mutex Timeout trying to acquire mutex Database::m_Query's write lock lock after 10000 milliseconds
13:26:24.936 E Mutex Timeout trying to acquire mutex Database::m_Query's write lock lock after 10000 milliseconds
13:26:48.606 E Database Error running MySQL query (1205): Lock wait timeout exceeded; try restarting transaction
UPDATE `variables` SET `config_value` = '2703180' WHERE `config_name` = 'world_gametime';
13:26:48.607 E 13:26:48.608 Database E[/quote]
Crashed during writing of logger, but it comes from the disconnection code vs updating game time.

Never seen an error in m_Query before.


Edit: This only seemed to happen once, when I closed my client window - likely a timing issue with 2 SQL updates? We should fix it, regardless.

Re: NT Crash Thread

Posted: Sun Jul 26, 2015 3:16 pm
by Blackstorm
If we see it again, we could move the world time backup to each 6min for example, it does not matter for me, and see what append.

Otherwise, the error say: "Mutex Timeout trying to acquire mutex Database::m_Query's write lock lock after 10000 milliseconds", maybe the previous request doesn't have unlocked the mutex in time or something else, and the world time request could not be executed...

Re: DB m_Query Lock crash

Posted: Sun Jul 26, 2015 3:21 pm
by John Adams
After this crash, I noticed my local dev machines MySQL service was behaving badly - ie., I could not TRUNCATE tables locally. I'm going to blame the massive amount of raw data I'm creating right now as the cause; this is likely not a valid crash (except for the crash part). It's more than likely my MySQL server was out of service when the writes were attempted.

Leaving this open in it's own thread to keep an eye on it for a while.