MSpawnList deadlock in ZoneServer::KillSpawn
Posted: Sun Mar 08, 2020 5:51 pm
The CombatProcess for clients is already in a state where MSpawnList is locked, see bool ZoneServer::SpawnProcess()
MSpawnList.readlock(__FUNCTION__, __LINE__);
for (itr = spawn_list.begin(); itr != spawn_list.end(); itr++) {...
CombatProcess(spawn);
problem is CombatProcess calls ZoneServer::KillSpawn while MSpawnList is already locked and then deadlocks.
These are the changes I am testing right now, its unfortunately merged with the disarm code I was working on: http://cutpon.com:3000/devn00b/EQ2EMu/c ... 41d5d434cd
We are still testing this just FYI, but heard this has been an issue for some time, maybe someone can find a better approach here, but this is the jist of the deadlock that causes the client to sit silent in the zone (no commands work, Client Process doesn't work)
I am a bit iffy about saying ZoneServer::CheckDeadSpawnRemoval has a MSpawnList lock (its called from the main zone process loop). However not saying the lock is already in place causes a deadlock.. cause MSpawnList is apparently locked.
MSpawnList.readlock(__FUNCTION__, __LINE__);
for (itr = spawn_list.begin(); itr != spawn_list.end(); itr++) {...
CombatProcess(spawn);
problem is CombatProcess calls ZoneServer::KillSpawn while MSpawnList is already locked and then deadlocks.
These are the changes I am testing right now, its unfortunately merged with the disarm code I was working on: http://cutpon.com:3000/devn00b/EQ2EMu/c ... 41d5d434cd
We are still testing this just FYI, but heard this has been an issue for some time, maybe someone can find a better approach here, but this is the jist of the deadlock that causes the client to sit silent in the zone (no commands work, Client Process doesn't work)
I am a bit iffy about saying ZoneServer::CheckDeadSpawnRemoval has a MSpawnList lock (its called from the main zone process loop). However not saying the lock is already in place causes a deadlock.. cause MSpawnList is apparently locked.