Petition to remove the /reload command

Discussion in 'Bukkit Discussion' started by Afforess, Oct 27, 2011.

Thread Status:
Not open for further replies.
     
  1. Offline

    Afforess

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    The reload command in bukkit is diabolical, and should be removed. I've stated this many times in private before, but I'm often surprised by the number of people who are unaware of the problems with reloading.

    Memory Leaks:
    To understand why the reload command is terrible, you have to understand how it works. /reload disables all active plugins, and then, creates a new instance of every plugin in the plugins folder. It does not reactivate the old, disabled plugins. It creates a new copy. Due to the way Java works, and how Bukkit implements it's classloaders, this causes a memory leak. This is easy to confirm with most java profilers. The memory leak is not super significant (I'd guess at most, 5mb per /reload), but it does exist. Unfortunately, Java's eccentricities make it pretty much impossible to fix this memory leak.

    The effects of the leak can be viewed by my profiling some months back. Nothing has changed with plugin loading since these screenshots were taken.

    Server running BukkitContrib without any reloads.

    Server running BukkitContrib 4 reloads later. (Plugins loaded 5 times total, 4 reloads + 1 startup)

    All of the classes and any static variables remain in memory.

    Poor Plugin Design:
    Memory leaks are not the worst part about the reload command. Many, MANY plugins handle reloads poorly, or not at all. I'm certain most server admins are painfully aware that when they use /reload, the console will spit out at least one error, usually more. Exceptions are extremely common with /reload. And before you begin to berate plugin developers for simple mistakes, know that it is often extremely difficult to handle reload situations perfectly, especially the more complex the plugin. The most complex case I am aware of is Spout, where we have literally, thousands of lines of code simply to handle the /reload command. And Spout still doesn't handle reloads perfectly. Plugins that use multiple threads to achieve their tasks (usually plugins using some form of SQL, or persistent storage....) will also fail to end their threads after the plugin shuts down. This means your server could be wasting CPU cycles for extra threads that are not needed or used.

    Lag, Lag, Lag:
    Assuming that your server has only selected the highest tier plugins, of exceeding quality that handle reload flawlessly, and has gigabytes of extra memory to handle any leaks from bukkit, reload will still lag for several seconds after you issue the command. It is not uncommon for players to be kicked for fly hacking, moving to quickly, or just to read time out from lag. You might as well have used the 15 seconds it takes to RESTART the server instead of reloading it.

    There are several plugins made specifically to offer a way to safely RESTART your server instead of reloading it, and I encourage admins to use them:

    http://forums.bukkit.org/threads/ad...w-v0-3_2-full-server-restarts-818-1060.20039/
    http://forums.bukkit.org/threads/ad...-automatic-rebooting-and-commands-1000.24652/
    http://forums.bukkit.org/threads/ad...t-down-at-the-same-time-every-day-1248.26101/
    http://forums.bukkit.org/threads/ad...detection-auto-saves-remote-console-1317.674/

    I'm personally inclined to simply block the reload command from any of my plugins, but I expect that would make admins unhappy. So instead, I'm trying to raise awareness of why the command is bad, what can happen when you use it, and alternatives for it.
    Icabash, dark navi, Jdwede and 41 others like this.
  2.  
  3. Offline

    Bertware

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    /Signed
    Reload uses 15MB RAM on my server
    However, if it dissapears, I would like a function to enable/disable only 1 plugin.
  4. Offline

    Celtic Minstrel

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    If you have one plugin written specifically for one server to do everything desired on that server, then sure, one plugin isn't a bad idea (though I still don't think it's a good idea). However, those plugins would not be worth releasing; chances are no-one other than that one server would ever want them.
  5. Online

    nkrecklow

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    The problem is that he is running "big" servers on those, it doesn't take that much to realize when you run the entire server on a plugin, there will be problems.
  6. Offline

    Adamki11s

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Yes a lot of plugins do handle reloads badly but developers should make sure to dispose of their data properly and instead of removing the command completely Bukkit should try to recode it to make it more efficient.

    Reloads are actually very effective, I personally hate having to restart a server and I find that sometimes during testing or updates having the restart the server ever time is a pain.

    This post has been edited 3 times. It was last edited by Adamki11s Jan 3, 2012.
    hclewk, ks07 and iPhysX like this.
  7. Offline

    hclewk

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    By the same token, it's just as bad to make Spout a single plugin. Why not break it into 100 different plugins? Because I know that as an experienced developer, there is a very significant benefit to code simplicity. I have 3 servers - each has it's own jar file with code referencing a shared library compiled into each jar. When bukkit updates, I download it to my computer and run a quick test off my local versions of the jars. Takes about 5 minutes. If they don't work (which has never (yes never) happened), I take about 2 minutes and tweak the code to make it work. If I had 10 plugins for each of my 3 servers, instead of a 5 minute test for each bukkit update, it would take 30 minutes or longer. Simplicity. I maintain one code base. You are saying I'm inexperience because I should be maintaining many more?

    True. Now if only my plugin was a "massive structure of easily breakable things" like your plugins that "were horrible, many bugs and glitches" (quoted directly from your single plugin, said by you).

    Gah! Somebody tell me why I feel compelled to respond to crap like this!
    BrassDoll and Sayshal like this.
  8. Offline

    hclewk

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Holy Crap! Somebody here has a brain! Thank you, thank you, thank you!
    SeptimMartin and Sayshal like this.
  9. Online

    nkrecklow

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Yes, I did say that, and if you had the ability to read, you would see the plugin it's concerning was my first.
  10. Offline

    DrBowe

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    It spits out errors because it's not coded to support reloads. This is because the reload command does have a lot of issues with it. Surely you wouldn't complain to a Car Company about not having any milk or eggs for sale inside their facility, right? Spout chooses to ignore the reload command for the several reasons listed--they're not covering anything up.

    Furthermore, this is not 'showing disrespect to the Bukkit team', it's giving constructive criticism. He's stating that there's an apparent flaw with the concept of a 'reload', and that if it's going to be done poorly, it'd be better off not being a feature of Bukkit at all.

    It may be convenient on the outside, but it does a whole slew of things wrong internally.

    This post has been edited 2 times. It was last edited by DrBowe Jan 3, 2012.
  11. Offline

    hclewk

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    My point was that you assumed plugins were "massive structures of easily breakable things" because you are (in the best of light) an inexperienced programmer. I am now assuming that you are a script kiddie who has been dabbling in java code for a few months, writing bukkit plugins. I've coded for a living for the past 7(ish) years. Let's hear your credentials.
    BrassDoll likes this.
  12. Online

    nkrecklow

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Certified in HTML5, CSS3, used PHP for 3 years now, and been "dabbling" it Java.
    It's easy to say, no matter what platform, it's not a good idea to base your entire thing of a central point that is easily breakable.
  13. Offline

    NuclearW Citrullus lanatus Administrator

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    @hclewk @steaks4uce
    I don't see how your current argument relates to the topic at hand, please discontinue it or take it to a conversation if you feel you must discuss it further as all it has done is throw this thread off topic.
    hclewk likes this.
  14. Offline

    Frozen91

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    /Signed

    Is it normal that static variables do no seem to be reload-persistent?

    This post has been edited 2 times. It was last edited by Frozen91 Jan 23, 2012.
  15. Offline

    ferrybig

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Thats says that plugins are unloaded at /reload, and not what they said at the begin
  16. Offline

    aciid

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Personally I find it really feckin' ennoying to have to restart the server because of spout.. need to sort myself out a test server :(
  17. Offline

    NinjaGrinch

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    As a server administrator myself I've come to realize one important thing. /reload is very broken and never works right on quite a bit of plugins. If you are going to maintain a server you should learn to use a test server, put together an update on the test server and when its ready take down your main server to push the update.
    Justin The Cynical likes this.
  18. Offline

    xKYLERxx

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    The /reload command, and the way it works, is necessary! I use it to update plugins I've made without restarting my server. I can make a quick bugfix, then upload and not worry about players raging at 45 restarts in 10 minutes. I think if people really care this much about it, then get a plugin that disables /reload. It's not very hard. 5 lines at the most. Come on, people. Do something better with your time.
  19. Offline

    Roadkill909

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    I'm very against this. Reloads help me fix bugs rapidly. If I'm really stuck on a bug I'll try something, compile, install, reload, repeat. That means obviously all my plugins are reload compatible. It's a really really handy developer tool for test servers, and probably works for small servers with few plugins as well.

    Also look at it from the bukkit staff's view. When you are as big as bukkit, you simply just can't remove something with out providing a better alternative. So the only thing this thread would accomplish, if the bukkit staff were to fulfill its demands, is tick off a portion of the community by removing a small feature of bukkit that not everyone uses.

    Yes, I agree it does not work for the "big server" who has 100+ plugins, and 50+ members online, however it is not a problem for them at all if they choose not to use it. However, the bukkit community isn't solely composed of big servers. The big servers know not to use it. The people who cannot use it really gain nothing from reload getting removed, and everyone else loses something useful.
    Adamki11s likes this.
  20. Offline

    iKeirNez

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    /signed

    This should be made as an option in bukkit.yml with a default of false.

    @EvilSeph
  21. Offline

    ks07

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    What's the point in that? If people don't want to use it, just don't use the command, adding a toggle doesn't achieve anything. :confused:
  22. Offline

    iKeirNez

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    It could potentially be dangerous with plugins that don't support /reload so only developers would really use it and server owners who have decided to take the risk.
  23. Offline

    jasvecht

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Indeed, obscuring the option would scare off most future server owners from it while giving current ones their features :)
  24. Offline

    Nefaro

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Against it

    While the points layed out are all valid, the reaction to remove or hide or obfuscate the command is rather damaging.

    /reload is and should be purely considered as a "development command". In that hindsight I agree, DO NOT USE IT FOR PRODUCT/LIVE SERVERS. Easy as that.

    It is the server owners responsibility to know the tools they are using, to know the commands they are using. Ignorance is not an excuse. Hence, if You know, the command is damaging DO NOT USE. If You do NOT KNOW what the command does DO NOT USE IT.

    Also if You find, that the plugin You are using, is damaging or any other way "damaged" You do not have to use it. Alternative is You notify the plugin maintainer of its shortcomings and get it fixed. Poor plugin design or implementation is no excuse to remove the /reload command. It is the plugin maintainers/developers responsibility to have a high quality product. It is the server owners/operators responsibility to know what they are running.

    Lag? Shouldn't be in this topic anyway.

    For me as a dev, /reload is the most used and most helpful command of them all. However, I wouldn't dream of using /reload in a final running populated server. That wouldn't be just stupid, wouldn't it ?
    ks07 and Nathan C like this.
  25. Offline

    sillyrosster

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    /signed

    I have 3 plugins that do not work after a reload, it's annoying and I've contacted the developer. Reloads have caused a lot of problems and lag for me.

    I don't think they should take it away, I think they should recode it to be more efficient.
  26. Offline

    ArchmageInc

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
  27. Offline

    TheFluffey

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    /signed

    Memory leaks as well as numerous other problems makes this unnecessary.
  28. Offline

    Waterflames

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    The point is: it doesn't work properly.
    It should either be removed or replaced by an improved alternative, but since I don't see them recoding the command any time soon they might aswell just remove it.
    Server owners are supposed to know that reload doesn't work properly, but the truth is that many simply don't.

    To those that say the plugin developers should just take care of the problem:
    Although it wouldn't fix everything, we should at least get a boolean indicating whether it is a reload or stop in the onDisable function.
  29. Offline

    Celtic Minstrel

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Something tells me you don't quite understand the meaning of the word "unnecessary"...
  30. Offline

    TheFluffey

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    For my server, in the most... Reloading everything can be done by just restarting, and that seems to be a lot more safe.
  31. Offline

    Celtic Minstrel

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Mm, maybe it's something else you didn't understand... let me clarify properly.

    I won't confirm or deny that /reload is unnecessary (that's really a matter of opinion); however, it's not unnecessary as a result of memory leaks as your post implies. Memory leaks don't make it unnecessary; they might make it unsafe, but not unnecessary.
  32. Offline

    TheFluffey

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    That is my point. I would rather restart the server properly than subject it to problems.
Thread Status:
Not open for further replies.

Share This Page