Scheduler going crazy

You think you've found a bug? Please report it here.

Moderators: Lapo, Bax

Post Reply
christophe.feerik
Posts: 19
Joined: 26 May 2009, 13:39
Location: Montpellier, France

Scheduler going crazy

Post by christophe.feerik »

Hello guys,

This morning when I looked into our logs, I've found a huge log file of 2,9 GB.
Normally, this file is at most 200/300 MB. So, I've investigated deeper.

I've found this exception appearing several thousand times without interruption :

Code: Select all

java.lang.NullPointerException
	at it.gotoandplay.smartfoxserver.util.scheduling.Scheduler.executeTasks(Scheduler.java:299)
	at it.gotoandplay.smartfoxserver.util.scheduling.Scheduler.run(Scheduler.java:223)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
And after that this line unendly :

Code: Select all

java.lang.NullPointerException
We had to restart the server to get back to a normal situation.

Any idea of the source of this ?
Christophe
Producer - Feerik
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Post by Lapo »

Before putting this in the bugs section we should investigate where the problem is.
Are you sure you are not creating too many Schedulers?
What server version is in use?
Are monitoring the thread count in the Admin Tool?

Thanks
Lapo
--
gotoAndPlay()
...addicted to flash games
christophe.feerik
Posts: 19
Joined: 26 May 2009, 13:39
Location: Montpellier, France

Post by christophe.feerik »

We are using SFS version 1.6.6 and BlueBox 1.0.5.

We are creating what we consider a fair amount of scheduled tasks through the scheduler. We have two tasks by game room and the server hosted at most 300 concurrent game rooms.

The thread count in the Admin Tool lies in a range from about 90 to 175 threads (12 of those threads comes from us, but the others are from SmartFox only).
Christophe
Producer - Feerik
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Post by Lapo »

Do you start a new scheduler for each Room?
Lapo
--
gotoAndPlay()
...addicted to flash games
christophe.feerik
Posts: 19
Joined: 26 May 2009, 13:39
Location: Montpellier, France

Post by christophe.feerik »

Yes we do, but from your reply, I guess we're wrong. :D

In each game room we have this in the init() function :

Code: Select all

scheduler = new Scheduler();
postMethodsTask = new Task("postMethods");
scheduler.addScheduledTask(postMethodsTask, 1, true, this);
scheduler.startService();
And proper cleaning is done in the destroy() function :

Code: Select all

postMethodsTask.active = false;
scheduler.stopService();
scheduler = null;
Christophe
Producer - Feerik
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Post by Lapo »

Well, I see two problems here.

1) Starting 1 Scheduler per Room is not so great. Not that it is horrible but the Scheduler can handle many tasks and using it just for one Room is a waste of resources especially when there are many Rooms

2) The error you are getting is a bit strange. I recall having seen this one earlier and I believe we fixed it with the 1.6.8 update.
I would suggest to upgrade (it's a very quick thing) and try again.

If you have any more troubles with that error send us an email and we'll send you a pre-release of the next coming update.

Patch 1.6.8: http://www.smartfoxserver.com/products/ ... #downloads
(scroll down a bit and you'll see it)
Lapo
--
gotoAndPlay()
...addicted to flash games
Post Reply