unicorn Ruby/Rack server user+dev discussion/patches/pulls/bugs/help
 help / color / mirror / code / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download mbox.gz: |
* Re: [ANN] unicorn 4.8.0.pre1 prerelease gem
  2013-12-09  9:54  7% [ANN] unicorn 4.8.0.pre1 prerelease gem Eric Wong
@ 2014-01-09 21:50  0% ` Eric Wong
  0 siblings, 0 replies; 3+ results
From: Eric Wong @ 2014-01-09 21:50 UTC (permalink / raw)
  To: mongrel-unicorn

Eric Wong <normalperson@yhbt.net> wrote:
>       tests: fix SO_REUSEPORT tests for old Linux and non-Linux
>       stream_input: avoid IO#close on client disconnect
>       t0300: kill off stray processes in test
>       always write PID file early for compatibility
>       doc: clarify SIGNALS and reference init example
>       rework master-to-worker signaling to use a pipe

Btw, has anybody tried this?  I haven't noticed any issues, and I'm
thinking about releasing this as 4.8.0 as-is (with some minor doc
updates)
_______________________________________________
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%]

* [ANN] unicorn 4.8.0.pre1 prerelease gem
@ 2013-12-09  9:54  7% Eric Wong
  2014-01-09 21:50  0% ` Eric Wong
  0 siblings, 1 reply; 3+ results
From: Eric Wong @ 2013-12-09  9:54 UTC (permalink / raw)
  To: mongrel-unicorn

Changes since 4.7.0:

Eric Wong (6):
      tests: fix SO_REUSEPORT tests for old Linux and non-Linux
      stream_input: avoid IO#close on client disconnect
      t0300: kill off stray processes in test
      always write PID file early for compatibility
      doc: clarify SIGNALS and reference init example
      rework master-to-worker signaling to use a pipe

gem install --pre unicorn

git://bogomips.org/unicorn
_______________________________________________
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 7%]

* Re: Unicorn 4.7.0 tests fail on OSX 10.7.5 and debian squeeze
  @ 2013-11-04 18:37  7% ` Eric Wong
  0 siblings, 0 replies; 3+ results
From: Eric Wong @ 2013-11-04 18:37 UTC (permalink / raw)
  To: unicorn list; +Cc: Andrew Hobson

Andrew Hobson <ahobson@gmail.com> wrote:
> On both my machines, it is commit 7c125886b5862bf20711bae22e6697ad46141434 that breaks the tests.

> : Finished tests in 0.041678s, 263.9282 tests/s, 1943.4714 assertions/s.
> :
> : 1) Failure:
> : test_reuseport(TestSocketHelper) [test/unit/test_socket_helper.rb:193]:
> : <1> expected but was
> : <512>.
> :
> : 11 tests, 81 assertions, 1 failures, 0 errors, 0 skips
> 
> I don't see how the current test can be platform independent.  The following diff fixes OSX for me:
> 
> diff --git a/test/unit/test_socket_helper.rb b/test/unit/test_socket_helper.rb
> index abc177b..2244442 100644
> --- a/test/unit/test_socket_helper.rb
> +++ b/test/unit/test_socket_helper.rb
> @@ -189,7 +189,6 @@ class TestSocketHelper < Test::Unit::TestCase
> port = unused_port @test_addr
> name = "#@test_addr:#{port}"
> sock = bind_listen(name, :reuseport => true)
> - cur = sock.getsockopt(Socket::SOL_SOCKET, SO_REUSEPORT).unpack('i')[0]
> - assert_equal 1, cur
> + assert sock.getsockopt(Socket::SOL_SOCKET, SO_REUSEPORT).bool
> end if defined?(SO_REUSEPORT)

I can't use .bool for Ruby 1.8, unfortunately.
I've just use assert_operator in my proposed patch below.

> The error I get when I test 4.7.0 on debian squeeze (in a VM):
> 
> : 1) Error:
> : test_reuseport(TestSocketHelper):
> : Errno::ENOPROTOOPT: Protocol not available

Oops, I forgot Linux < 3.9 is still widely in use(!)

> I don't know how unicorn should deal with that.  I suppose ignoring
> ENOPROTOOPT if RUBY_PLATFORM =~ /linux/ is an option, but it is
> certainly not an appealing one.

I'll just ignore it in the test.  If a user requests it, then they'll
see the error (but we leave SO_REUSEPORT off by default)

Will push the following:

From: Eric Wong <normalperson@yhbt.net>
Subject: [PATCH] tests: fix SO_REUSEPORT tests for old Linux and non-Linux

On BSD-derived platforms the getsockopt true value may be any
(>= 0) value, not just one as it is on Linux.

Additionally, SO_REUSEPORT is only supported since Linux 3.9, so
folks on older kernels may not have it available.  We still define it
for Linux since kernel upgrades are usually more common than glibc
upgrades.

Note: we will still raise an exception at runtime if a user
explicitly requests :reuseport in their config and runs an
older Linux kernel.

Reported-by: Andrew Hobson <ahobson@gmail.com>
---
 test/unit/test_socket_helper.rb | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/test/unit/test_socket_helper.rb b/test/unit/test_socket_helper.rb
index abc177b..8992757 100644
--- a/test/unit/test_socket_helper.rb
+++ b/test/unit/test_socket_helper.rb
@@ -190,6 +190,8 @@ class TestSocketHelper < Test::Unit::TestCase
     name = "#@test_addr:#{port}"
     sock = bind_listen(name, :reuseport => true)
     cur = sock.getsockopt(Socket::SOL_SOCKET, SO_REUSEPORT).unpack('i')[0]
-    assert_equal 1, cur
-  end if defined?(SO_REUSEPORT)
+    assert_operator cur, :>, 0
+  rescue Errno::ENOPROTOOPT
+    # kernel does not support SO_REUSEPORT (older Linux)
+  end
 end
-- 
1.8.4.483.g7fe67e6.dirty
_______________________________________________
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-3 of 3 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2013-11-04 18:04     Unicorn 4.7.0 tests fail on OSX 10.7.5 and debian squeeze Andrew Hobson
2013-11-04 18:37  7% ` Eric Wong
2013-12-09  9:54  7% [ANN] unicorn 4.8.0.pre1 prerelease gem Eric Wong
2014-01-09 21:50  0% ` Eric Wong

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).