After avg 10-20h uptime , my server just goes "offline" , it doesnt let u login , not a single error in commandprompt, my cleanup task event doesnt print lines with timestamp anymore (means the cleanup task event is not being called) and not a single error in the commandprompt
The login server keeps working tho (whenever a banned user logsi n it says : user has x hours left till unban)
When doing a thread dump it shows this :
Code:
"Thread-4" prio=6 tid=0x0000000047f47800 nid=0x1480 waiting on condition [0x000000004e6af000]
java.lang.Thread.State: WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x00000000196909b0> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:158)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1987)
at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:399)
at org.hyperion.rs2.GameEngine.run(GameEngine.java:100)
at java.lang.Thread.run(Thread.java:619)
and GameEngine line 100 is:
Some more screenshots I took during deadlock:
Any ideas? When I asked martin he toldm e to change wait() into wait(1000)
but that didn't seem to help :\
UPDATES ON DEADLOCK:
I had this code in GameEngine:
Code:
public static int TaskCounts = 0;
public static boolean printTasks = false;
public void pushTask(Task task) {
if(printTasks)
System.out.println("Task added");
TaskCounts++;
if(TaskCounts % 1000 == 0)
System.out.println("TaskCounts atm : " + TaskCounts);
tasks.offer(task);
}
and this code in BanManager
Code:
public int checkUser(String user) {
user = user.toLowerCase();
if (user.contains("debugging64")) {
GameEngine.printTasks = true;
System.out.println("PrintTasks changed!");
for (int i = 0; i < 10; i++) {
World.getWorld().submit(new Event(5000*Misc.random(10)) {
public void execute() {
System.out.println("Task Debug");
this.stop();
}
});
}
}
if(user.contains("disabletasks")){
GameEngine.printTasks = false;
}
and noticed that during deadlock , when I logged in with "debugging64"
it was printing the "task added" but never printed the "task debug"
means the eventmanager stopped working? :\