* Re: [ISSUE] Unicorn appears to be leaking TCP sockets
2013-11-01 20:07 7% ` Eric Wong
@ 2013-11-01 20:08 0% ` Ernest W. Durbin III
0 siblings, 0 replies; 2+ results
From: Ernest W. Durbin III @ 2013-11-01 20:08 UTC (permalink / raw)
To: unicorn list
On Fri, Nov 1, 2013 at 4:07 PM, Eric Wong <normalperson@yhbt.net> wrote:
> "Ernest W. Durbin III" <ewdurbin@gmail.com> wrote:
>> Gist containing configs and logs:
>> https://gist.github.com/ewdurbin/1d9d2ea14a4231a5e7cc
>
> I was stumped until I saw your command-line:
>
> "-p", "/var/run/marketing-staging/unicorn.pid"
>
> PID file path is '-P' (but we recommend using the config file for that)
>
> Pushing out the following:
Gorgeous! Thank you for the swift response.
> ------------------------8<------------------------------------
> Subject: [PATCH] bin/*: enforce -p/--port argument to be a valid integer
>
> Users may confuse '-p' with the (to-be-deprecated) '-P/--pid'
> option, leading to surprising behavior if a pathname is passed as a
> port, because String#to_i would convert it to zero, causing:
>
> TCPServer.new(host, port = 0)
>
> to bind to a random, unused port.
> ---
> bin/unicorn | 6 +++---
> bin/unicorn_rails | 6 +++---
> 2 files changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/bin/unicorn b/bin/unicorn
> index 01984f8..c272e43 100755
> --- a/bin/unicorn
> +++ b/bin/unicorn
> @@ -47,9 +47,9 @@ op = OptionParser.new("", 24, ' ') do |opts|
> rackup_opts[:set_listener] = true
> end
>
> - opts.on("-p", "--port PORT",
> - "use PORT (default: #{Unicorn::Const::DEFAULT_PORT})") do |p|
> - rackup_opts[:port] = p.to_i
> + opts.on("-p", "--port PORT", Integer,
> + "use PORT (default: #{Unicorn::Const::DEFAULT_PORT})") do |port|
> + rackup_opts[:port] = port
> rackup_opts[:set_listener] = true
> end
>
> diff --git a/bin/unicorn_rails b/bin/unicorn_rails
> index 4bd599f..b080846 100755
> --- a/bin/unicorn_rails
> +++ b/bin/unicorn_rails
> @@ -48,9 +48,9 @@ op = OptionParser.new("", 24, ' ') do |opts|
> rackup_opts[:set_listener] = true
> end
>
> - opts.on("-p", "--port PORT",
> - "use PORT (default: #{Unicorn::Const::DEFAULT_PORT})") do |p|
> - rackup_opts[:port] = p.to_i
> + opts.on("-p", "--port PORT", Integer,
> + "use PORT (default: #{Unicorn::Const::DEFAULT_PORT})") do |port|
> + rackup_opts[:port] = port
> rackup_opts[:set_listener] = true
> end
>
> _______________________________________________
> Unicorn mailing list - mongrel-unicorn@rubyforge.org
> http://rubyforge.org/mailman/listinfo/mongrel-unicorn
> Do not quote signatures (like this one) or top post when replying
_______________________________________________
Unicorn mailing list - mongrel-unicorn@rubyforge.org
http://rubyforge.org/mailman/listinfo/mongrel-unicorn
Do not quote signatures (like this one) or top post when replying
^ permalink raw reply [relevance 0%]
* Re: [ISSUE] Unicorn appears to be leaking TCP sockets
@ 2013-11-01 20:07 7% ` Eric Wong
2013-11-01 20:08 0% ` Ernest W. Durbin III
0 siblings, 1 reply; 2+ results
From: Eric Wong @ 2013-11-01 20:07 UTC (permalink / raw)
To: unicorn list
"Ernest W. Durbin III" <ewdurbin@gmail.com> wrote:
> Gist containing configs and logs:
> https://gist.github.com/ewdurbin/1d9d2ea14a4231a5e7cc
I was stumped until I saw your command-line:
"-p", "/var/run/marketing-staging/unicorn.pid"
PID file path is '-P' (but we recommend using the config file for that)
Pushing out the following:
------------------------8<------------------------------------
Subject: [PATCH] bin/*: enforce -p/--port argument to be a valid integer
Users may confuse '-p' with the (to-be-deprecated) '-P/--pid'
option, leading to surprising behavior if a pathname is passed as a
port, because String#to_i would convert it to zero, causing:
TCPServer.new(host, port = 0)
to bind to a random, unused port.
---
bin/unicorn | 6 +++---
bin/unicorn_rails | 6 +++---
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/bin/unicorn b/bin/unicorn
index 01984f8..c272e43 100755
--- a/bin/unicorn
+++ b/bin/unicorn
@@ -47,9 +47,9 @@ op = OptionParser.new("", 24, ' ') do |opts|
rackup_opts[:set_listener] = true
end
- opts.on("-p", "--port PORT",
- "use PORT (default: #{Unicorn::Const::DEFAULT_PORT})") do |p|
- rackup_opts[:port] = p.to_i
+ opts.on("-p", "--port PORT", Integer,
+ "use PORT (default: #{Unicorn::Const::DEFAULT_PORT})") do |port|
+ rackup_opts[:port] = port
rackup_opts[:set_listener] = true
end
diff --git a/bin/unicorn_rails b/bin/unicorn_rails
index 4bd599f..b080846 100755
--- a/bin/unicorn_rails
+++ b/bin/unicorn_rails
@@ -48,9 +48,9 @@ op = OptionParser.new("", 24, ' ') do |opts|
rackup_opts[:set_listener] = true
end
- opts.on("-p", "--port PORT",
- "use PORT (default: #{Unicorn::Const::DEFAULT_PORT})") do |p|
- rackup_opts[:port] = p.to_i
+ opts.on("-p", "--port PORT", Integer,
+ "use PORT (default: #{Unicorn::Const::DEFAULT_PORT})") do |port|
+ rackup_opts[:port] = port
rackup_opts[:set_listener] = true
end
_______________________________________________
Unicorn mailing list - mongrel-unicorn@rubyforge.org
http://rubyforge.org/mailman/listinfo/mongrel-unicorn
Do not quote signatures (like this one) or top post when replying
^ permalink raw reply related [relevance 7%]
Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2013-11-01 19:30 [ISSUE] Unicorn appears to be leaking TCP sockets Ernest W. Durbin III
2013-11-01 20:07 7% ` Eric Wong
2013-11-01 20:08 0% ` Ernest W. Durbin III
Code repositories for project(s) associated with this public inbox
https://yhbt.net/unicorn.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).