Timer suddenly speeds up and crashes gamemode
#1

Hi,

After having done some development works on my gamemode, I recently transferred it onto a VPS server that operates a Debian 8 OS. The gamemode was working fine on Windows but when I run it on Debian, the server works for a while and then suddenly all functions start executing at such speed that it crashes the game mode.

I have debugged the callbacks that use the only one global timer I have but I can't see any correlation as of yet.

Код:
[16:58:52] [debug] Callback Sekundnik executed
[16:58:53] [debug] Callback Sekundnik called
[16:58:53] [debug] Callback Sekundnik executed
[16:58:55] [debug] Callback Sekundnik called
[16:58:55] [debug] Callback Sekundnik executed
[16:58:56] [debug] Callback Sekundnik called
[16:58:56] [debug] Callback Sekundnik executed
[16:58:56] [debug] Callback Sekundnik called
[16:58:56] [debug] Callback Dwadziescia_Sekund called
[16:58:56] [debug] Callback Dwadziescia_Sekund executed
[16:58:56] [debug] Callback Sekundnik executed
[16:58:56] [debug] Callback Sekundnik called
[16:58:56] [debug] Callback Sekundnik executed
[16:58:56] [debug] Callback Sekundnik called
[16:58:56] [debug] Callback Piec_Sekund called
[16:58:56] [debug] Callback Piec_Sekund executed
[16:58:56] [debug] Callback Sekundnik executed
[16:58:56] [debug] Callback Sekundnik called
[16:58:56] [debug] Callback Sekundnik executed
[16:58:56] [debug] Callback Sekundnik called
[16:58:56] [debug] Callback Sekundnik executed
Sekundnik - One second timer
Piec_Sekund - Five seconds timer
Dwadziescia_Sekund - Twenty seconds timer

What you see above is the one second timer being called a every a little more than one second and then suddenly starting to get called repeatedly 100s of times per second. The server gets overloaded and crashes.

The gamemode uses only one timer as such but every second it updates global variables such as global_timer_5_seconds and triggers respective callbacks if the value is higher than for example 5. There is a limit of calling one timer-callback per second, as follows:

PHP код:
    if(global_5_second_timer_value 5)
    {
        
global_5_second_timer_value 0;
        
Piec_Sekund();
    }
    else if(
global_20_second_timer_value 20)
    {
        
global_20_second_timer_value 0;
        
Dwadziescia_Sekund();
    }
    else if(
global_60_second_timer_value 60)
    {
        
global_60_second_timer_value 0;
        
Minuta();
    }
    else if(
global_300_second_timer_value 300)
    {
        
global_300_second_timer_value 0;
        
Piec_Minut();
    }
    else if(
global_600_second_timer_value 600)
    {
        
global_600_second_timer_value 0;
        
Dziesiec_Minut();
    }
    else if(
global_900_second_timer_value 900)
    {
        
global_900_second_timer_value 0;
        
Pietnascie_Minut();
    }
    if(
SCRIPT_DEBUG == 1)    printf("[debug] Callback Sekundnik executed"); 
So I suppose (and the logs seem to support this claim) the functions are not called in an overlapping manner.

Any ideas what could be the reason?
Reply
#2

As a matter of fact, I have disabled all timers and timer-related callbacks and the server still keeps crashing after some time of normal operation. There are no lags, nothing indicates that the serves is struggling or anything. The whole server just freeezes and subsequently crashes.

Any ideas?
Reply
#3

Don't forget to create a pawn.cfg file in /pawno/ directory, in the file write -d3 -r and save it. That will give you the error line in your code, so you'll know what to fix.
Reply
#4

I've got the crash detector installed and I disabled the timers so they are no longer running. The server still crashes though and the crash detector does not reveal anything. I will try the profiler now but any other thoughts?

Quote:
Originally Posted by Astralis
Посмотреть сообщение
Don't forget to create a pawn.cfg file in /pawno/ directory, in the file write -d3 -r and save it. That will give you the error line in your code, so you'll know what to fix.
My script compiles without errors.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)