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

Bug: Multiple Processes Per Plugin #64

Closed
tooolbox opened this issue Apr 24, 2021 · 6 comments
Closed

Bug: Multiple Processes Per Plugin #64

tooolbox opened this issue Apr 24, 2021 · 6 comments
Assignees
Labels
bug This is a bug

Comments

@tooolbox
Copy link
Collaborator

tooolbox commented Apr 24, 2021

I wrote a Go plugin modeled precisely on your example.

Based on my testing, plugins are launched as processes and are never shut down, meaning a new instance is spawned every time a plugin function is called, and the old instances don't shut down. I noticed you have a concern about data races surrounding shutdown?

Spawning infinite plugin instances is not an option for me. Can this be fixed?

@tooolbox tooolbox changed the title Bug: Plugins Don't Shut Down Bug: Multiple Processes Per Plugin Apr 24, 2021
@xyproto
Copy link
Owner

xyproto commented Apr 24, 2021

Thanks for reporting! I will look into this.

@tooolbox
Copy link
Collaborator Author

Great, no problem. If it makes a difference, I'm running on Windows.

In the meantime I have hacked it by making the plugin process kill itself after a few seconds.

@xyproto xyproto self-assigned this Apr 24, 2021
@xyproto xyproto added the bug This is a bug label Jun 9, 2021
@xyproto
Copy link
Owner

xyproto commented Mar 24, 2022

Part of the idea of the plugin system, as opposed to just running an executable, is that the plugin can keep running and continue to respond as calls to the plugin is made.

See also: https://github.com/natefinch/pie#about-pie

So, the plugin executables should ideally not be closed per call, but there shouldn't be a new one started per call either (so that's a bug).

@tooolbox
Copy link
Collaborator Author

My one question (docs point) would be what the expected actions would be when updating or replacing plugins, in the case that they're long-running. I guess you restart Algernon in that case?

@xyproto
Copy link
Owner

xyproto commented Mar 25, 2022

Yes, just like with FastCGI, where executables keep running, I would think that restarting the server is what's required.

@tooolbox
Copy link
Collaborator Author

I never actually got this fixed. The plugin process keeps running in Windows even when PluginCode is called without a second argument.

Seems like this is actually the problem: natefinch/pie#14

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

No branches or pull requests

2 participants