Comments (9)
I have an example of how to reproduce this:
https://gist.github.com/1197586
https://gist.github.com/1197876
from starman.
Note that this may or may not work with procfs because of the way Net::Server works. A quick test shows that there's no issue with Mac OS X.
from starman.
I keep failing to reproduce this bug on Mac, and also hear issues from linux users (I think). Can someone specify 100% reproducible simple step to replicate this bug? I do have a linux environment to test and fix if there's any.
from starman.
OK i could reproduce now - is it correct that it only happens on a) linux, b) when you use PSGI file other than app.psgi and c) when you use --preload-app.
from starman.
Sort of related, Net::Server does this:
delete $ENV{$_} for $self->hup_delete_env_keys;
sub hup_delete_env_keys { return qw(PATH) }
which means if you run starman using just 'perl', relying on your $PATH configured correctly, then sending HUP could potentially run the process again from a wrong path. This is issue number one.
from starman.
I think restarting the server with exec $0, @ARGV
is not exactly what we want - we should override Net::Server's behavior of handling HUP signals. Also the code to get the original command line in Net::Server is just insane:
https://metacpan.org/source/RHANDOM/Net-Server-0.99/lib/Net/Server.pm#L162
http://unicorn.bogomips.org/SIGNALS.html handles HUP to restart config files, then restart all workers. It will pick up code changes unless the preload_app is used, which we could replicate in Starman as well.
If you use --preload-app
then the code changes won't be picked up, which could be confusing to some people. We can document that in --preload-app
that you can run starman behind Server::Starter to make HUP to fully restart the server while preloading the app entirely.
from starman.
0.29_01 is shipped to CPAN. Test it.
from starman.
I have tested version 0.29_90 and it works exactly as you have described above and in the documentation. A HUP signal now successfully restarts the workers. Thanks for sorting this out.
from starman.
Closing.
from starman.
Related Issues (20)
- Starman in Production HOT 2
- Implement --max-keepalive-requests HOT 3
- POSIX::setgid not implemented on this architecture HOT 1
- starman hangs on make tests (Win 7, Strawberry perl) HOT 1
- Starman is missing ExtUtils::Config requirement HOT 1
- Support custom proctitles
- Dependency module name misspelling
- plackup: Use of uninitialized value $opt in lc at /home/vagrant/perl5/lib/perl5/Starman/Server.pm line 80.
- Feature request: Ability to run Starman in non-forking mode HOT 1
- How to use with systemd ExecReload and ExecStop? HOT 1
- start_server ignores https/ssl configuration of starman/plackup HOT 1
- allow client errors to be detected HOT 2
- Support for server-side trailer headers with chunk-encoded responses
- on some hosts requests are too slow - any ideas ? HOT 1
- *
- Please add config option to `chmod` a UNIX socket HOT 1
- --listen and --host options do not support IPv6 addresses HOT 4
- Add worker timeout option HOT 3
- Starman worker zombie processes showing up HOT 1
- Errors/warnings not logged HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from starman.