PretendYoureXyzzy
PretendYoureXyzzy copied to clipboard
Potential race condition if resetState() is called while a timer task is executing
Specifically, it looks like if the game is trying to deal cards, it's possible that whiteDeck has been set to null in resetState.
2014-05-05 14:30:47,274 [timer-task-10] ERROR net.socialgamer.cah.SafeTimerTask - Exception running SafeTimerTask
java.lang.NullPointerException
at net.socialgamer.cah.data.Game.getNextWhiteCard(Game.java:1120)
at net.socialgamer.cah.data.Game.dealState(Game.java:737)
at net.socialgamer.cah.data.Game.startNextRound(Game.java:1103)
at net.socialgamer.cah.data.Game.skipIdleJudge(Game.java:883)
at net.socialgamer.cah.data.Game.access$4(Game.java:863)
at net.socialgamer.cah.data.Game$4.process(Game.java:855)
at net.socialgamer.cah.SafeTimerTask.run(SafeTimerTask.java:13)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
Around the same time, the server went unresponsive. Java is also pegging a CPU. It looks like it's the JVM itself pegging a thread, possibly in the garbage collector... "VM Thread", which isn't very helpful.