Sugestion: Ability to remove plugins while the server is running

I’m not sure whether this is possible or not but it would be fantastic if it was possible to remove plugins while the server was running without stopping it. This would be useful if a server admin wanted to try out plugins on the main server and see if they work out and be able to remove them if they don’t play nicely. It would also be useful to be able to remove plugins that just break for no reason or if an exploit with the plugin was discovered.

3 Likes

That was already possible in bukkit via other plugins. But some plugins had a tendency to break

1 Like

This has already been discussed. Not sure what the link to the thread was, but it was stated that we are free to create plugins alike what people have used before on Bukkit (PlugMan). However, this would not be possible to be integrated inside the actual core, because plugins are loaded in a different way, and it would be too complicated and messy to start, stop and/or reload plugins.

Yeah I tried using a plugin that allowed that functionality but it just didn’t work with most other plugins.

Great idea - and please also add a kind of /reload - would make things much more easy!

I don’t really support the idea.
The /reload command causes a lot of bug and memory problem.
I would prefer a configuration reload event or similar.

2 Likes

That would be impossible.
Once a class loader has loaded a class, it cannot be unloaded.
Plugins can affect things outside the scope of its own classes and would be impossible to revert any changes

There was a good discussion about why this won’t be happening over on this thread.

3 Likes

Thanks for linking that instead of just saying it had allready been talked about like most people do.

Good idea :smile:

Isn’t it possible to remove the old plugin instance with some kind of garbage collection to avoid memory leaks?

While a config reload command would be useful, I don’t think memory leaks are too much of an issue during development. Perhaps even block hotswapping off in production builds.

How about require devs to have plugin disable method?

There is no way to guarantee that it is implemented correctly.

Replace “reload” with “remove” or “disable”… it stays the same.

As well look at the original thread for more infos… Plugin reloading/enabling - #18 by teozkr

Classes can be unloaded and they are by the Java VM.

But plugins are often times not self-contained. They connect to other plugins. Other plugins connect to it. It may leave a reference to itself somewhere.

It only takes one hanging reference for it to become impossible to unload a plugin fully.

It is still possible to do a formal reload and tell a plugin to disable itself and then re-enable itself, but there’s no guarantee that there isn’t a memory leak happening going on that will last until the server or game is shutdown.

2 Likes

A feature like this @craftbot101, would be fantastic for mega servers.
One thing to note though, there could be possible bugs client side if such a feature was implemented.
Such a feature would require lots of thought and be carefully planned out and implemented.
Another note, plugins that require dependency’s will crash when the required dependency drops out.
It would be like the /reload all over again. Nasty corrupted files.

  • TangentSpy

yea i used /reload in bukkit many times that the command crashed

If this ever works with normal Sponge plugins…

I’m still sure it will break if using Forge methods from plugin. Not really useful, as I can just restart the server when needed.

One way to compensate this issue with mega servers is to have a an optional feature which allows players to be thrown into a hub server or lobby server on server restart or disconnection. When the server comes back online, the players simply reconnect to that server from the hub server or lobby server.

  • TangentSpy