Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the ability to reload plugins without restarting the proxy #38

Open
kharidiron opened this issue Sep 26, 2016 · 2 comments
Open

Add the ability to reload plugins without restarting the proxy #38

kharidiron opened this issue Sep 26, 2016 · 2 comments

Comments

@kharidiron
Copy link
Member

From @dopeghoti on August 6, 2016 15:45

This will allow for implementing most updates without a full-on server restart. I've seen this done with other similar Python projects, so it should be doable. I will look into the specifics of the implementation.

Copied from original issue: kharidiron#35

@AMorporkian
Copy link

AMorporkian commented Oct 2, 2016

I swear to god I had this before. Maybe that was in the original StarryPy. I think I'd probably be the best fit to take a look at this, since the import machinery in PluginManager is pretty dark magic that I imagine not too many people would be comfortable tinkering with. I'll add it to my todo list for next week.

@AMorporkian AMorporkian self-assigned this Oct 2, 2016
@AMorporkian
Copy link

AMorporkian commented Oct 2, 2016

Wait, I had a look through some old branches I have on my local machine and I see why I didn't have it in 3k. The problem is that if there are active waiting coroutines at the moment you decide to reload, you can't really just dissassociate the existing instance. The problem is that if that coroutine never resolves, then that instance and all its references (think other plugins that are dependencies) never gets garbage collected and over time you'll just get incredible memory leaks.

So, I see a potential solution here. However, it would require eliminating all @asyncio.coroutine's from the plugin methods and implementing a new one that keeps track of all active plugin waiters. That way, if we call a reload, we can simply cancel those futures and the instances will be garbage collected. Seems like it'd be simple enough.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants