1. Hey Folks,
    Noticed that all repeat timers seem to break after a few hours of being up. Not sure what is causing this, but pretty much every Timer.repeat breaks after about 8-10 hours of running. Have also noticed that I'm not the only person having this issue.

    Highly doubt its another plugin that is causing this, but removed a bunch of plugins that were not required, and still seem to be having the issue.

    If you guys need more information, feel more than welcome to ask!

    Have also tried adding in things to revive the timer by checking if its alive on player connection, and reviving it if its not around, but it still does not seem to help for some reason. The only thing that seems to bring it back is reloading the plugins that have the timer die.
     
  2. Wulf

    Wulf Community Admin

    Please post your code and the actual errors you are receiving. I've not experienced this issue, but generally timers break because a plugin is either using them improperly or calling something inside them that is broken.
     
  3. Its not my plugin thats breaking. Its any timer that has a timer.repeat that runs the same timer for at least 7+ hours.
    For instance, here are some of the plugins where the timer quits functioning after a few hours;
    http://oxidemod.org/resources/airdrop-settings.785/
    http://forum.rustoxide.com/resources/rotag-radevent.808/
    http://oxidemod.org/resources/day-night-system.671/

    The timers within these break without any error in console, and as said before, won't function until I oxide.reload the plugin or restart the server.

    As you can see in this thread, some other people are complaining about timers as well;
    http://oxidemod.org/threads/airdrop-settings.6517/page-7

    Have also posted in the threads of the other ones to see if other people are having the problem there.
     
  4. Wulf

    Wulf Community Admin

    All of those plugins don't seem to be calling the timers properly, so those timers will continue to stack up every time they are reloaded, so that's likely the cause right there. The timers should be calling self.Plugin at the end of them. See http://docs.oxidemod.org/?lua#timer.repeat.
     
  5. Just to clarify, should it be exactly
    self.Plugin
    Or should Plugin be replaced with something like that plugins name?

    Looked at the timer in your update plugin, and it does not have self.Plugin in the timer.repeat.
    timer.Repeat(tonumber(self.Config.Settings.CheckInterval), 0, function() self:UpdateCheck() end)
     
  6. Wulf

    Wulf Community Admin

    Airdrop Settings, replace line 30 with:
    Code:
    timer.Repeat(self.Config.AirdropSettings.DropFrequency * 60, 0, function() self:SpawnPlane() end, self.Plugin)
    ... replace line 384 with:
    Code:
    timer.Once(1, function() self:CheckSupplyLanded(Entity) end, self.Plugin)
    ... replace line 418 with:
    Code:
    timer.Once(1, function() self:CheckSupplyLanded(SupplyDrop) end, self.Plugin)
    ... replace line 421 with:
    Code:
    timer.Once(self.Config.AirdropSettings.SupplyStayTime * 60, function() self:RemoveEntity(SupplyDrop) end, self.Plugin)
    RotAG-RadEvent, replace line 21 with:
    Code:
    timer.Once(self.Config.RadTime, function() self:TurnRad() return end, self.Plugin)
    ... replace line 34 with:
    Code:
    end, self.Plugin)
    m-Time, replace line 162 with:
    Code:
    timer.Repeat( UpdateInterval, 0, function() Sky.Cycle.Hour = TimeData.Hour end, self.Plugin )
    ... replace line 165 with:
    Code:
    timer.Repeat( UpdateInterval, 0, function() self:TimeTick() end, self.Plugin )
    ... replace line 634 with:
    Code:
    timer.Repeat( UpdateInterval, 0, function() self:TimeTick() end, self.Plugin )
    ... replace line 656 with:
    Code:
    timer.Repeat( UpdateInterval, 0, function() Sky.Cycle.Hour = TimeData.Hour end, self.Plugin )
    ... replace line 687 with:
    Code:
    timer.Repeat( UpdateInterval, 0, function() self:TimeTick() end, self.Plugin )
    ... replace line 728 with:
    Code:
    timer.Repeat( UpdateInterval, 0, function() self:TimeTick() end, self.Plugin )
    ... replace line 768 with:
    Code:
    timer.Repeat( UpdateInterval, 0, function() self:TimeTick() end, self.Plugin )
    See if those changes make any difference. I run piles of plugins with timers and often leave them running for many hours with no issues.
     
  7. Alright, will get back to you with the results. Thanks for the help Wulf!
     
  8. Thank you for information, going to send link to this thread to all authors of this plugins. Also going to fix this on my server, i also tired of this (already had script what automatically reload plugins via rcon). I hope everything will work fine after this changes.

    Also this concern to timer.once what also requires self.Plugin as third parameter if used timer.once inside timer.once or it will stop work.
     
    Last edited by a moderator: Mar 16, 2015
  9. Wulf

    Wulf Community Admin

    If plugin authors Destory() the timers on Unload, it's generally fine. Any type of timer should pass self.Plugin to it though, which are shown in the replacements previously mentioned.
     
  10. 6 hours in an all the timer.repeats have failed again, no error log, using the fixes you gave above. Rad Events have stopped working, Day and Night cycle is back to default, and no airdrops have came in the last 45 minutes, even though their set to happen ever 23 minutes.
     
    Last edited by a moderator: Mar 17, 2015
  11. Hmm, i'll also then make test plugin and run it for long time on test server and then report. If it will stop working - then it will be an issue with oxide/rust.
    [DOUBLEPOST=1426557273][/DOUBLEPOST]So i wrote this and will report after some time what happens.

    Code:
    PLUGIN.Name = "Timer Test"
    PLUGIN.Title = "Timer Test"
    PLUGIN.Version = V(0, 0, 1)
    PLUGIN.Description = "Testing oxide timer"
    PLUGIN.Author = "AlexALX"function PLUGIN:Init()
        local count = 0
        self.TestTimer = timer.Repeat (600 , 0 , function() count = count + 1; print("TEST TIMER - #"..count) end, self.Plugin )
    endfunction PLUGIN:Unload()
        if self.TestTimer then self.TestTimer:Destroy() end
    end
     
  12. Did a test on my end too with different code but pretty much the same, died after 4 hours.
    [DOUBLEPOST=1426576557][/DOUBLEPOST]Running it now on a server with no other plugins, should give us a good idea on whether or not its oxide. Will get back to you in the morning with the results.
     
  13. For me timers still working on my test server:

    [3/17/2015 1:45:21 PM] [Oxide] 1:45 PM [Info] TEST TIMER - #59

    Already 590 minutes (almost 10 hours) Going to continue waiting.
     
  14. Hmm, strange, my test timer died after 6 and a half hours on the same as vanilla server (Oxide with just a plugin with the test timer).

    Will try it with the exact code you used @AlexALX_[rus-ua] to see if I get the same or different results.
     
    Last edited by a moderator: Mar 17, 2015
  15. Wulf

    Wulf Community Admin

    I've been testing numerous times without any issues yet. I did change up the previously posted plugin a bit, removing the unnecessary PLUGIN.Name, Unload hook, and timers as variables, and added more timers and types of timers. I've also added some functions in a couple timers that will error, but they don't affect the other timers.
    Code:
    PLUGIN.Title = "Timer Test"
    PLUGIN.Version = V(0, 0, 1)
    PLUGIN.Description = "Oxide timer test"
    PLUGIN.Author = "Wulf"function PLUGIN:OnServerInitialized()
        local count = 0
        timer.Repeat(5, 0, function() count = count + 1; print("5 SECOND REPEAT TIMER - #" .. count) end, self.Plugin)
        timer.Repeat(7, 0, function() count = count + 1; print("7 SECOND REPEAT TIMER - #" .. count); self:Test() end, self.Plugin)
        timer.Repeat(10, 0, function() count = count + 1; print("10 SECOND REPEAT TIMER - #" .. count) end, self.Plugin)
        timer.Repeat(25, 0, function() count = count + 1; print("10 SECOND REPEAT TIMER - #" .. count); print(test) end, self.Plugin)
        timer.Once(3, function() count = count + 1; print("3 SECOND ONCE TIMER - #" .. count) end, self.Plugin)
        timer.Once(20, function() count = count + 1; print("3 SECOND ONCE TIMER - #" .. count) end, self.Plugin)
        timer.NextFrame(function() count = count + 1; print("NEXT FRAME TIMER - #" .. count) end)
    endfunction PLUGIN:Test()
        timer.Once(0.1, function() print("INSTANT ONCE SUB TIMER") end, self.Plugin)
    end
    9777ce3712467ad0beda082ca8ae18f6.png
     
  16. Yeah, they do perfectly fine for me until about 4-8 hours in. Now two hours in on this test, and so far its doing fine, will check it again tonight.
     
  17. @Wulf
    Nice test plugin :D but probably also should to check timer.once inside timer.once as someone do in some plugins.

    As for now i accidentally shutdown my test server so timers going from zero again :D for now #34.. Probably i'll also later test Wulf version of plugin with some additions and will see.

    Also just small offtopic, Wulf - how you choose lua as language for code tag? In drop down menu i have only General, PHP, JS, CSS, HTML. Whats wrong :) I know that i can manually edit code tag but i lazy for this :p
     
  18. Wulf

    Wulf Community Admin

    It uses any language tag supported by GeSHi Syntax Highlighter, so you can manually add them to the code tag. I actually added the supported plugin languages now, so you can just select them that way too. :)
    [DOUBLEPOST=1426629369][/DOUBLEPOST]
    So far at 4 hours and counting with numerous repeat timers.
    [DOUBLEPOST=1426641422,1426629156][/DOUBLEPOST]Out of curiosity, what is the version of the Oxide build you are using @Spiritwind?
     
  19. Using version
    v2.0.443

    Anyways, using the code from Alex's timer test, it only made it through to #21 for me...

    Here is the entire log for that run.
    http://paste.ubuntu.com/10618690/

    I'll now shut it down and try with yours Wulf. If you need any more info, be sure and let me know.

    Also, if you need it, I can get you set up to access tcadmin for it, just pm me if this is the case.

    ---
    See you updated Oxide, will get it switched over to that version now.
     
  20. Wulf

    Wulf Community Admin

    It's odd that you seem to be the only one having the issue. The only difference here is your actual server machine, as everyone else is using the same software, Oxide version, and plugin for testing. The timers in Oxide rely on Unity, which I believe relies on your machine's time.