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


    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:

    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.
  2. Offline


    Wow, thanks for explaining it all. Up until about a week ago I used /reload a lot, while I was still configuring plugins on my server that did not have a specific reload command. I would always get soo many errors, and I had no idea why, specifically with MultiVerse and LogBlock. No one had mentioned to me before that the /reload command could cause more harm than good. It wasn't until I found out that /reload caused all those errors that I stopped using it, and more so when I installed Spout a few days ago, which is a-m-a-z-i-n-g might I add. I'm surprised how few people are active on the Spout forums, it's such an amazing plugin/client/visionary program that way more people should be drooling over it like I am.

    But yes, great post Afforess. Good stuff. Good stuff.

    Now I sign...?


    An alternative would be great though, if one were available so that I don't have to kick everyone for 30 seconds while my server restarts.
  3. Offline


    if you love it so much, drool about it on the spout forums?
    this is bukkit, not spout
  4. Offline


    a.) Don't see what's wrong with writing two sentences about Spout. This is a discussion forum. And it's a positive comment.

    b.) Spout is a plugin made for Bukkit. Not another game, not another topic, not an evil succubus trying to destroy civilization.

    c.) Afforess actually mentions it in his OP as one of the reasons /reload should be taken off, and how they wrote over 1000 lines of code just to semi-successfully have Spout be compatible with the command.

    d.) Afforess is also one of the few lead core devs on Spout. If there's anywhere to mention it, it's here.

    e.) It was part of my argument, and is causing no one harm nor breaking any of the rules.

    f.) I just installed Spout a few days ago and I'm very happy with it. Again, nothing wrong with saying I like it, especially here.

    Don't really see why you feel like attacking me.

    acecheesecr14 likes this.
  5. Offline

    Celtic Minstrel

    Not saying I agree with Sabersamus, but...
    This would be more appropriate in the past tense. Also, it was never made for Bukkit. Only for CraftBukkit.
  6. Offline


    Lol alright, CraftBukkit. :p

    And what would be more appropriate in past tense? Sorry, I'm very tired...
  7. Offline


    5mb is nothing. A few cpu cycles is nothing. not /signed
  8. Offline


    Don't like it, don't use it! Maybe add a warning message before /reload +ask them for a command like /reload confirm to confirm it, but remove? No way! It's waaaayy to useful for when I'm updating plugins, writing plugins, testing plugins etc... I always restart when I'm done and then I don't use it again, but damn it's so useful when you are testing....
  9. Offline

    unimatrix Bukkit Sponsor

    I find that you are fighting for the wrong thing , instead of fighting against the /reload function i suggest you fight for a cause that forces all plugin devs to add a reload to their plugin.
  10. Offline


    Bukkit has the onreload listener. maybe the solution is of instead of letting bukkit call the on reload listener which is not implemented by a lot of plugins, just let bukkit call the ondisable and onenable methode. just let bukkit simulate a server restart from the perspective of the plugins without disconnecting the players or actually restarting.)

    If bukkit can provide a view to the plugins like the server was actually restarting then no problems should occur. or should they?
  11. Offline


    I'm not against /reload. It's useful when testing my plugins. Although it's bad for running an actual server, it's still very useful when testing plugins. In my opinion, if you don't like it, then don't use it.
  12. Offline


    I'm not against /reload. I'm against its abuse. I'm also for a way to properly intercept a reload event.
    ferrybig likes this.
  13. Offline


    /reload should be removed or written properly without doing any harm to server and plugins.
  14. Offline

    mbaxter ʇıʞʞnq ɐ sɐɥ ı

    Closing as there's just useless bumping now.
Thread Status:
Not open for further replies.

Share This Page