-
Notifications
You must be signed in to change notification settings - Fork 84
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
starman --listen decided as backlog queue by Net::Server inside #57
Comments
I can't reproduce:
Check the versions of Plack, Starman and Net::Server and ugprade to the latest to see if the problem exists. If it is fixed by upgrading versions, report it to me so that we can fix the dependency if there's any mistake. |
Thanks! I made same tests and result exactly as your one starman runs Plack::Runner and uses parse_options() for parsing of @argv Plack::Runner::parse_options parses an options but parsed options are not deleted from hash and kept in $self->{argv} Starman::Server::run kept options in @argv again before Net::Server::PreFork::run: And after runs the $self->SUPER::run (Net::Server::PreFork::run) I think the 'listen' option is passed to Net::Server::PreFork again through @argv and affects there in some situations. I don't understand why i cannot reproduce with your example (application Plack/eg/dot-psgi/Hello.psgi) but i see errors there with same Plack/Starman/Net::Server modules for my project. |
I made: vi /usr/local/lib/perl5/site_perl/5.16.2/Starman/Server.pm Added code:
before $self->SUPER::run and got: $ less /tmp/dump.txt
|
So Net::Server in @argv has --listen as IP:PORT but he expects there length of queue (backlog) |
and how can you reproduce? Can you make a reproducible script that doesn't |
Net::Server:
|
I will try it through 2-3 hours |
I am trying to reproduce with Plack/eg/dot-psgi/Hello.psgi but i cannot while Comment from Net::Server:process_args: we want subsequent calls to not overwrite or add to previously set values so that command line arguments winI think better way to remove --listen from @argv before Net::Server::PreFork::run method execution |
Sure, that's why we clear stuff out of |
Yes, may be Plack cleans @argv but Starman restores @argv before Net::Server::run execution I am seeing the code of Net::Server now because i want to understand how to reproduce problem with --listen |
Right, but that ... Ok, now that I tried to confirm the behavior and found that I will remove this and argv will not propagated to Net::Server. |
Yes, i confirm that i don't have any warnings from IO::Socket now :) |
I believe that the option listen of starman (IP:PORT format for example) is decided by Net::Server inside as backlog option because the last looks in @argv as i think
From doc of Net::Server:
listen \d+ SOMAXCONN
I got messages in error.log of starman:
Argument "XX.XX.XX.XX:PPPP" isn't numeric in numeric gt (>) at /usr/local/lib/perl5/5.16.2/x86_64-linux-thread-multi/IO/Socket.pm line 224.
I looked in code, added 'carp' to $SIG{WARN} inside Socket.pm (224) and got:
Argument "XX.XX.XX.XX:PPPP" isn't numeric in numeric gt (>) at /usr/local/lib/perl5/5.16.2/x86_64-linux-thread-multi/IO/Socket.pm line 224.
at /usr/local/lib/perl5/site_perl/5.16.2/Net/Server.pm line 325
The submodule Net::Server::Proto::TCP has lines:
I am sure that listen there as my IP:PORT
So when i run:
starman --listen IP:PORT --backlog 6000
I have backlog as 'IP:PORT' (may be first digit in my IP address)
Please check up this
Thanks
Perlover
The text was updated successfully, but these errors were encountered: