-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
server(plugins): update without downtime #6443
base: develop
Are you sure you want to change the base?
server(plugins): update without downtime #6443
Conversation
94f6fb5
to
38b0c31
Compare
I don't know why the test is failing, it seems unrelated to the changes and it works when I test locally. @Chocobozzz , currently this PR doesn't handle multiple parallell installs. The package.json is copied when install process begins, so if there's multiple parallell installations only the last one will be stored in package.json. I propose to move the plugin install/update/uninstall processes to be handled by a job instead. Cons: a) More stable server. If the server restarts just after an admin has started a plugin installation it won't be aborted. |
38b0c31
to
5e13fda
Compare
Create a new folder each time a new plugin/theme is installed or updated. The folder name is created based on the package.json content hash. closes Chocobozzz#4828
Upon an failed update, rollback to the previous version.
* To avoid long running operations in HTTP requests. * To not collidate with other install/update/uninstall operations.
4e8eace
to
c6a1114
Compare
@Chocobozzz Let me know what you think of this draft. If you're positive to the solution I'll fix the broken tests. |
@Chocobozzz Ping |
I'm sorry but I unfortunately don't have time at the moment to review your work |
This method seems interesting since we have many "issues" with the decache system, but I fear an unavoidable increase of the PeerTube process memory no? |
Hi, I don't remember the details how this is implemented, but I can't remember it should increase the process memory. Why do you fear it? |
Because every time we update a plugin we re-load all of them, and since we can't control the ESM cache I wonder if the RAM would not increase indefinitely |
We only reload the updated plugin, but yes the old plugin version will still be loaded in the cache. So the memory usage will increase until PT is restarted. It should be possible determine how much this will affect with tests done with clinic.js or similar. To avoid increasing memory usage the server code be restarted either on every or update or depending on memory usage/size. A more robust solution could be to run plugins as spawned microservices that communicates with PT over HTTP. |
Description
Related issues
closes #4828
Has this been tested?