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: Support for Rack 3 headers formatted as arrays
  2022-12-09 21:52  6% Support for Rack 3 headers formatted as arrays Martin Posthumus
@ 2022-12-10  2:42  0% ` Eric Wong
  0 siblings, 0 replies; 20+ results
From: Eric Wong @ 2022-12-10  2:42 UTC (permalink / raw)
  To: Martin Posthumus; +Cc: unicorn-public

Martin Posthumus <martin.posthumus@gmail.com> wrote:
> Hello,
> 
> As of Rack v3, the internal representation of headers containing multiple
> values appears to have been changed to use an array of strings rather than a
> newline-separated string. Pull request visible here:
> https://github.com/rack/rack/pull/1793
> 
> The Rack changelog (https://github.com/rack/rack/blob/main/CHANGELOG.md)
> also includes this entry under 3.0.0:
> "Response header values can be an Array to handle multiple values (and no
> longer supports \n encoded headers)."

OK.  unicorn has no choice to support all Rack as long as Rack <= 2
applications exist...

> I'm running into some serialization issues with this sort of header when
> trying to run an application on Unicorn that makes use of multiple cookies.
> The `set-cookie` header is returning what appears to be a stringified array:
> 
> set-cookie: ["my.cookie=.....; domain=......; path=/", "rack.session=......;
> path=/; httponly"]
> 
> Which in turn results in cookies getting registered with names like
> `["rack.session` rather than `rack.session`.
> 
> I'm not especially familiar with Unicorn's internals, but poking around a
> little bit, it looks like this might be related to the definition of
> `http_response_write` in lib/unicorn/http_response.rb, where it handles
> newline-separated strings, but not arrays. I can confirm that the set-cookie
> header value appears to be an array in this method, not a string.

Does this work for you?

diff --git a/lib/unicorn/http_response.rb b/lib/unicorn/http_response.rb
index b23e521..3308c9b 100644
--- a/lib/unicorn/http_response.rb
+++ b/lib/unicorn/http_response.rb
@@ -40,7 +40,10 @@ def http_response_write(socket, status, headers, body,
           # key in Rack < 1.5
           hijack = value
         else
-          if value =~ /\n/
+          case value
+          when Array # Rack 3
+            value.each { |v| buf << "#{key}: #{v}\r\n" }
+          when /\n/ # Rack 2
             # avoiding blank, key-only cookies with /\n+/
             value.split(/\n+/).each { |v| buf << "#{key}: #{v}\r\n" }
           else

> At present I'm only seeing this issue when running on a Unicorn server. When
> I swap out something like webrick, it appears the array values are handled
> as expected.

Yeah, I haven't looked deeply at Rack 3 support and hate dealing
with the culture of breaking changes prevalent in the Ruby world :<

^ permalink raw reply related	[relevance 0%]

* Support for Rack 3 headers formatted as arrays
@ 2022-12-09 21:52  6% Martin Posthumus
  2022-12-10  2:42  0% ` Eric Wong
  0 siblings, 1 reply; 20+ results
From: Martin Posthumus @ 2022-12-09 21:52 UTC (permalink / raw)
  To: unicorn-public

Hello,

As of Rack v3, the internal representation of headers containing 
multiple values appears to have been changed to use an array of strings 
rather than a newline-separated string. Pull request visible here: 
https://github.com/rack/rack/pull/1793

The Rack changelog (https://github.com/rack/rack/blob/main/CHANGELOG.md) 
also includes this entry under 3.0.0:
"Response header values can be an Array to handle multiple values (and 
no longer supports \n encoded headers)."



I'm running into some serialization issues with this sort of header when 
trying to run an application on Unicorn that makes use of multiple 
cookies. The `set-cookie` header is returning what appears to be a 
stringified array:

set-cookie: ["my.cookie=.....; domain=......; path=/", 
"rack.session=......; path=/; httponly"]

Which in turn results in cookies getting registered with names like 
`["rack.session` rather than `rack.session`.


I'm not especially familiar with Unicorn's internals, but poking around 
a little bit, it looks like this might be related to the definition of 
`http_response_write` in lib/unicorn/http_response.rb, where it handles 
newline-separated strings, but not arrays. I can confirm that the 
set-cookie header value appears to be an array in this method, not a string.


At present I'm only seeing this issue when running on a Unicorn server. 
When I swap out something like webrick, it appears the array values are 
handled as expected.


Thank you,

Martin

^ permalink raw reply	[relevance 6%]

* Build error of 5.1.0 due to RString
@ 2016-11-07 17:13  4% Olivier FAURAX
  0 siblings, 0 replies; 20+ results
From: Olivier FAURAX @ 2016-11-07 17:13 UTC (permalink / raw)
  To: unicorn-public

Hello,

I'm new to Ruby & Unicorn, and I get a build error trying to compile 
unicorn 5.1.0.

It is about a RString that has not some members, so perhaps an API has 
been modified somewhere.
I tried with unicorn 5.2.0, and I get the same error.

Thanks in advance
Olivier

$ uname -a
Linux git.example.com 3.16.0-76-generic #98~14.04.1-Ubuntu SMP Fri Jun 
24 17:04:54 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

$ ruby --version
ruby 2.1.9p490 (2016-03-30 revision 54437) [x86_64-linux]

$ gem install unicorn -v '5.1.0' -i vendor/bundle/ruby/2.1.0 --verbose
GET https://api.rubygems.org/specs.4.8.gz
200 OK
HEAD https://api.rubygems.org/api/v1/dependencies
200 OK
GET https://api.rubygems.org/api/v1/dependencies?gems=unicorn
200 OK
GET https://api.rubygems.org/api/v1/dependencies?gems=raindrops
200 OK
GET https://api.rubygems.org/api/v1/dependencies?gems=kgio
200 OK
/opt/bitnami/apps/gitlab/htdocs/vendor/bundle/ruby/2.1.0/gems/unicorn-5.1.0/.CHANGELOG.old
...
[long list of unicorn-5.1.0 files]
...
/opt/bitnami/apps/gitlab/htdocs/vendor/bundle/ruby/2.1.0/gems/unicorn-5.1.0/unicorn.gemspec
Building native extensions.  This could take a while...
/opt/bitnami/ruby/bin/ruby extconf.rb
checking for SIZEOF_OFF_T in ruby.h... yes
checking for SIZEOF_SIZE_T in ruby.h... yes
checking for SIZEOF_LONG in ruby.h... yes
checking for rb_str_set_len() in ruby.h... no
checking for rb_hash_clear() in ruby.h... no
checking for gmtime_r() in time.h... yes
creating Makefile
make "DESTDIR=" clean
make "DESTDIR="
compiling httpdate.c
compiling unicorn_http.c
In file included from unicorn_http.rl:8:0:
ext_help.h: In function ‘rb_18_str_set_len’:
ext_help.h:18:15: error: ‘struct RString’ has no member named ‘len’
    RSTRING(str)->len = len;
                ^
ext_help.h:19:15: error: ‘struct RString’ has no member named ‘ptr’
    RSTRING(str)->ptr[len] = '\0';
                ^
make: *** [unicorn_http.o] Error 1
ERROR:  Error installing unicorn:
         ERROR: Failed to build gem native extension.

     Building has failed. See above output for more information on the 
failure.
make failed, exit code 2

Gem files will remain installed in 
/opt/bitnami/apps/gitlab/htdocs/vendor/bundle/ruby/2.1.0/gems/unicorn-5.1.0 
for inspection.
Results logged to 
/opt/bitnami/apps/gitlab/htdocs/vendor/bundle/ruby/2.1.0/extensions/x86_64-linux/2.1.0-static/unicorn-5.1.0/gem_make.out

^ permalink raw reply	[relevance 4%]

* [PATCH 1/4] remove RubyForge and Freecode references
  @ 2014-09-22  1:05  9% ` Eric Wong
  0 siblings, 0 replies; 20+ results
From: Eric Wong @ 2014-09-22  1:05 UTC (permalink / raw)
  To: unicorn-public; +Cc: Eric Wong

Both sites are gone.
---
 GNUmakefile     |  7 -------
 Rakefile        | 44 --------------------------------------------
 unicorn.gemspec |  1 -
 3 files changed, 52 deletions(-)

diff --git a/GNUmakefile b/GNUmakefile
index 50819fc..6916b6e 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -245,15 +245,8 @@ $(pkgtgz): .manifest fix-perms
 package: $(pkgtgz) $(pkggem)
 
 release: verify package $(release_notes) $(release_changes)
-	# make tgz release on RubyForge
-	rubyforge add_release -f -n $(release_notes) -a $(release_changes) \
-	  $(rfproject) $(rfpackage) $(VERSION) $(pkgtgz)
 	# push gem to Gemcutter
 	gem push $(pkggem)
-	# in case of gem downloads from RubyForge releases page
-	-rubyforge add_file \
-	  $(rfproject) $(rfpackage) $(VERSION) $(pkggem)
-	$(RAKE) fm_update VERSION=$(VERSION)
 else
 gem install-gem: GIT-VERSION-FILE
 	$(MAKE) $@ VERSION=$(GIT_VERSION)
diff --git a/Rakefile b/Rakefile
index 01ff5d0..37569ce 100644
--- a/Rakefile
+++ b/Rakefile
@@ -1,47 +1,3 @@
-# -*- encoding: binary -*-
-autoload :Gem, 'rubygems'
-require 'wrongdoc'
-
-cgit_url = Wrongdoc.config[:cgit_url]
-git_url = Wrongdoc.config[:git_url]
-
-desc "post to FM"
-task :fm_update do
-  require 'tempfile'
-  require 'net/http'
-  require 'net/netrc'
-  require 'json'
-  version = ENV['VERSION'] or abort "VERSION= needed"
-  uri = URI.parse('https://freecode.com/projects/unicorn/releases.json')
-  rc = Net::Netrc.locate('unicorn-fm') or abort "~/.netrc not found"
-  api_token = rc.password
-  _, subject, body = `git cat-file tag v#{version}`.split(/\n\n/, 3)
-  tmp = Tempfile.new('fm-changelog')
-  tmp.puts subject
-  tmp.puts
-  tmp.puts body
-  tmp.flush
-  system(ENV["VISUAL"], tmp.path) or abort "#{ENV["VISUAL"]} failed: #$?"
-  changelog = File.read(tmp.path).strip
-
-  req = {
-    "auth_code" => api_token,
-    "release" => {
-      "tag_list" => "Experimental",
-      "version" => version,
-      "changelog" => changelog,
-    },
-  }.to_json
-
-  if ! changelog.strip.empty? && version =~ %r{\A[\d\.]+\d+\z}
-    Net::HTTP.start(uri.host, uri.port, :use_ssl => true) do |http|
-      p http.post(uri.path, req, {'Content-Type'=>'application/json'})
-    end
-  else
-    warn "not updating freshmeat for v#{version}"
-  end
-end
-
 # optional rake-compiler support in case somebody needs to cross compile
 begin
   mk = "ext/unicorn_http/Makefile"
diff --git a/unicorn.gemspec b/unicorn.gemspec
index 9456db2..8623d44 100644
--- a/unicorn.gemspec
+++ b/unicorn.gemspec
@@ -26,7 +26,6 @@ Gem::Specification.new do |s|
   s.files = manifest
   s.homepage = Wrongdoc.config[:rdoc_url]
   s.rdoc_options = rdoc_options
-  s.rubyforge_project = %q{mongrel}
   s.test_files = test_files
 
   # for people that are absolutely stuck on Rails 2.3.2 and can't
-- 
EW


^ permalink raw reply related	[relevance 9%]

* [ANN] unicorn 4.0.0.2.g19f7 prerelease
@ 2011-06-29  7:29  5% Eric Wong
  0 siblings, 0 replies; 20+ results
From: Eric Wong @ 2011-06-29  7:29 UTC (permalink / raw)
  To: mongrel-unicorn-GrnCvJ7WPxnNLxjTenLetw
  Cc: rainbows-talk-GrnCvJ7WPxnNLxjTenLetw

I just pushed a prerelease gem to RubyGems.org with the following
changes.  Please let us know if there were any other regressions in
4.0.0.

Expect a final 4.0.1 release soonish...

Full git changelog (pushed to git://bogomips.org/unicorn.git):

commit 19f798301ac1884f423640efafb277b071bb5439
Author: Eric Wong <normalperson-rMlxZR9MS24@public.gmane.org>
Date:   Wed Jun 29 07:19:32 2011 +0000

    fix per-worker listen directive in after_fork hook
    
    The testcase for this was broken, too, so we didn't notice
    this :<
    
    Reported-by: ghazel-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org on the Rainbows! mailing list,
    http://mid.gmane.org/BANLkTi=oQXK5Casq9SuGD3edeUrDPvRm3A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

commit 38672501206c9e64d241e3d8571f70b198f0c1e5
Author: Eric Wong <normalperson-rMlxZR9MS24@public.gmane.org>
Date:   Mon Jun 27 20:51:16 2011 +0000

    configurator: truncate timeouts to 32-bit LONG_MAX
    
    IO.select in Ruby can't wait longer than this.  This
    means Unicorn can't support applications that take
    longer than 68 years to respond :(

-- 
Eric Wong
_______________________________________________
Rainbows! mailing list - rainbows-talk-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org
http://rubyforge.org/mailman/listinfo/rainbows-talk
Do not quote signatures (like this one) or top post when replying


^ permalink raw reply	[relevance 5%]

* Re: permissions on ChangeLog and NEWS
  2013-11-25  6:01 12% permissions on ChangeLog and NEWS Ken Dreyer
@ 2013-11-25  6:52  7% ` Eric Wong
  0 siblings, 0 replies; 20+ results
From: Eric Wong @ 2013-11-25  6:52 UTC (permalink / raw)
  To: unicorn list; +Cc: Ken Dreyer

Ken Dreyer <ktdreyer@ktdreyer.com> wrote:
> Would you mind using the newer version of wrongdoc when you release
> the next version of Unicorn?

Oops, will do.  Just upgraded the build/release machine :x
Thanks for the catch.
_______________________________________________
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%]

* permissions on ChangeLog and NEWS
@ 2013-11-25  6:01 12% Ken Dreyer
  2013-11-25  6:52  7% ` Eric Wong
  0 siblings, 1 reply; 20+ results
From: Ken Dreyer @ 2013-11-25  6:01 UTC (permalink / raw)
  To: mongrel-unicorn

Hello,

Thank you very much for Unicorn. I'm working on packaging the gem for
Fedora [1]. Our "rpmlint" tool found that the permissions of the
ChangeLog and NEWS files were set to 0600 (instead of something more
liberal like 0644).

I see this is fixed upstream in wrongdoc [2], and released in wrongdoc 1.6.2.

Since this was fixed in git a while ago, I was surprised to see this
is still an issue in the recent release of the Unicorn 4.7.0 gem.
Would you mind using the newer version of wrongdoc when you release
the next version of Unicorn?

Thank you very much for your consideration,
- Ken

PS. Please CC me as I am not subscribed to the list.

[1] https://bugzilla.redhat.com/786636
[2] http://bogomips.org/wrongdoc.git/commit/?id=4ed10b7cc4c4e7394416167314e94cef74906d63
_______________________________________________
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 12%]

* [PATCH] auto-generate Unicorn::Const::UNICORN_VERSION
  @ 2013-02-08 18:55 14% ` Eric Wong
  0 siblings, 0 replies; 20+ results
From: Eric Wong @ 2013-02-08 18:55 UTC (permalink / raw)
  To: unicorn list; +Cc: Maurizio De Santis

Maurizio De Santis <m.desantis@morganspa.com> wrote:
> Hello,
> 
> I want to report that unicorn-4.6.0/lib/unicorn/const.rb declares
> UNICORN_VERSION = "4.5.0", which I think should be "4.6.0".

Oops, I've been meaning to move that constant over to an auto-generated file
using GIT-VERSION-GEN.  This should work:

--------------------------------- 8< ------------------------------
>From cb0623f25db7f06660e563e8e746bfe0ae5ba9c5 Mon Sep 17 00:00:00 2001
From: Eric Wong <normalperson@yhbt.net>
Date: Fri, 8 Feb 2013 18:50:07 +0000
Subject: [PATCH] auto-generate Unicorn::Const::UNICORN_VERSION

This DRYs out our code and prevents snafus like the 4.6.0
release where UNICORN_VERSION stayed at 4.5.0

Reported-by: Maurizio De Santis <m.desantis@morganspa.com>
---
 .gitignore           |  1 +
 GIT-VERSION-GEN      | 69 ++++++++++++++++++++++++++--------------------------
 GNUmakefile          |  2 +-
 lib/unicorn/const.rb |  4 +--
 4 files changed, 37 insertions(+), 39 deletions(-)

diff --git a/.gitignore b/.gitignore
index 50c2736..19a82d6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -22,3 +22,4 @@ pkg/
 /man
 /tmp
 /LATEST
+/lib/unicorn/version.rb
diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN
index 56aef5f..e5d414a 100755
--- a/GIT-VERSION-GEN
+++ b/GIT-VERSION-GEN
@@ -1,40 +1,39 @@
-#!/bin/sh
-
-GVF=GIT-VERSION-FILE
-DEF_VER=v4.6.0
-
-LF='
-'
+#!/usr/bin/env ruby
+DEF_VER = "v4.6.0"
+CONSTANT = "Unicorn::Const::UNICORN_VERSION"
+RVF = "lib/unicorn/version.rb"
+GVF = "GIT-VERSION-FILE"
+vn = DEF_VER
 
 # First see if there is a version file (included in release tarballs),
 # then try git-describe, then default.
-if test -f version
-then
-	VN=$(cat version) || VN="$DEF_VER"
-elif test -d .git -o -f .git &&
-	VN=$(git describe --abbrev=4 HEAD 2>/dev/null) &&
-	case "$VN" in
-	*$LF*) (exit 1) ;;
-	v[0-9]*)
-		git update-index -q --refresh
-		test -z "$(git diff-index --name-only HEAD --)" ||
-		VN="$VN-dirty" ;;
-	esac
-then
-	VN=$(echo "$VN" | sed -e 's/-/./g');
-else
-	VN="$DEF_VER"
-fi
+if File.exist?(".git")
+  describe = `git describe --abbrev=4 HEAD 2>/dev/null`.strip
+  case describe
+  when /\Av[0-9]*/
+    vn = describe
+    system(*%w(git update-index -q --refresh))
+    unless `git diff-index --name-only HEAD --`.chomp.empty?
+      vn << "-dirty"
+    end
+    vn.tr!('-', '.')
+  end
+end
+
+vn = vn.sub!(/\Av/, "")
+
+# generate the Ruby constant
+new_ruby_version = "#{CONSTANT} = '#{vn}'\n"
+cur_ruby_version = File.read(RVF) rescue nil
+if new_ruby_version != cur_ruby_version
+  File.open(RVF, "w") { |fp| fp.write(new_ruby_version) }
+end
 
-VN=$(expr "$VN" : v*'\(.*\)')
+# generate the makefile snippet
+new_make_version = "GIT_VERSION = #{vn}\n"
+cur_make_version = File.read(GVF) rescue nil
+if new_make_version != cur_make_version
+  File.open(GVF, "w") { |fp| fp.write(new_make_version) }
+end
 
-if test -r $GVF
-then
-	VC=$(sed -e 's/^GIT_VERSION = //' <$GVF)
-else
-	VC=unset
-fi
-test "$VN" = "$VC" || {
-	echo >&2 "GIT_VERSION = $VN"
-	echo "GIT_VERSION = $VN" >$GVF
-}
+puts vn if $0 == __FILE__
diff --git a/GNUmakefile b/GNUmakefile
index ea13486..34a2d95 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -155,7 +155,7 @@ clean:
 man html:
 	$(MAKE) -C Documentation install-$@
 
-pkg_extra := GIT-VERSION-FILE ChangeLog LATEST NEWS \
+pkg_extra := GIT-VERSION-FILE lib/unicorn/version.rb ChangeLog LATEST NEWS \
              $(ext)/unicorn_http.c $(man1_paths)
 
 ChangeLog: GIT-VERSION-FILE .wrongdoc.yml
diff --git a/lib/unicorn/const.rb b/lib/unicorn/const.rb
index fcc30c0..51d7394 100644
--- a/lib/unicorn/const.rb
+++ b/lib/unicorn/const.rb
@@ -7,9 +7,6 @@
 # improvement over using the strings directly.  Symbols did not really
 # improve things much compared to constants.
 module Unicorn::Const
-
-  UNICORN_VERSION = "4.5.0"
-
   # default TCP listen host address (0.0.0.0, all interfaces)
   DEFAULT_HOST = "0.0.0.0"
 
@@ -44,3 +41,4 @@ module Unicorn::Const
 
   # :startdoc:
 end
+require 'unicorn/version'
-- 
1.8.1.2.526.gf51a757
_______________________________________________
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 14%]

* Re: .manifest file?
  @ 2012-11-14  3:00  5% ` Eric Wong
  0 siblings, 0 replies; 20+ results
From: Eric Wong @ 2012-11-14  3:00 UTC (permalink / raw)
  To: unicorn list

mike <michael.p.thompson@gmail.com> wrote:
> Just switched form a zip download to pulling the master branch of git.
> The .gemspec file is trying to parse a .manifest. Was this supposed to
> be included or generated? I am just poking around about it now.

It should be autogenerated with "make gem"

(wrongdoc (a dev-dependency) needs to be installed to generate the
ChangeLog/NEWS files, but that should run well under rbx).
_______________________________________________
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 5%]

* [ANN] unicorn 4.3.0.2.g4551 gem prerelease
@ 2012-04-27 22:00  5% Eric Wong
  0 siblings, 0 replies; 20+ results
From: Eric Wong @ 2012-04-27 22:00 UTC (permalink / raw)
  To: mongrel-unicorn; +Cc: Joel Nimety, George, Matt Smith

Can you guys test this out?  Thanks.  I'll make a real 4.3.1 release
tomorrow.

>From RubyGems.org:  gem install --pre unicorn

ChangeLog since v4.3.0:

commit 4551c8ad4d63d4031c618f76d39532b39e88f9be
Author: Eric Wong <normalperson@yhbt.net>
Date:   Fri Apr 27 14:42:38 2012 -0700

    stream_input: call shutdown(2) if a client EOFs on us
    
    In case the Rack app forks before a client upload is complete,
    shutdown(2) the socket to ensure the client isn't attempting to
    read from us (even if it explicitly stopped writes).

commit 04901da5ae0b4655c83be05d24ae737f1b572002
Author: Eric Wong <normalperson@yhbt.net>
Date:   Fri Apr 27 11:48:16 2012 -0700

    http_server: ignore ENOTCONN (mostly from shutdown(2))
    
    Since there's nothing unicorn can do to avoid this error
    on unconnected/halfway-connected clients, ignoring ENOTCONN
    is a safe bet.
    
    Rainbows! has long had this rescue as it called getpeername(2)
    on untrusted sockets
-- 
_______________________________________________
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 5%]

* Re: [PATCH] Ensure that 'make gem' builds the documentation too.
  @ 2011-06-06 17:51 28% ` Eric Wong
  0 siblings, 0 replies; 20+ results
From: Eric Wong @ 2011-06-06 17:51 UTC (permalink / raw)
  To: unicorn list

Hongli Lai <hongli@phusion.nl> wrote:
> >From bfefc2cf0efb0913a42862886363b3140dcdbb2a Mon Sep 17 00:00:00 2001
> From: Hongli Lai (Phusion) <hongli@phusion.nl>
> Date: Mon, 6 Jun 2011 13:39:00 +0200
> Subject: [PATCH] Ensure that 'make gem' builds the documentation too.
> 
> If autogenerated documentation files, like man pages, don't exist then
> 'make gem' will fail, complaining that some files are not found. By
> depending the 'gem' target on the 'doc' target we ensure that 'make gem'
> always works.
> 
> Signed-off-by: Hongli Lai (Phusion) <hongli@phusion.nl>

Oops, this was a regression introduced when I switched to wrongdoc
in f62ef19a4aa3d3e4ce1aa37a499907ff776a8964

Perhaps this is better?  It'll also affect the tgz target and not
just the gem target.

diff --git a/GNUmakefile b/GNUmakefile
index da55052..61fb739 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -164,7 +164,7 @@ pkg_extra := GIT-VERSION-FILE ChangeLog LATEST NEWS \
 ChangeLog: GIT-VERSION-FILE .wrongdoc.yml
 	wrongdoc prepare
 
-.manifest: ChangeLog $(ext)/unicorn_http.c
+.manifest: ChangeLog $(ext)/unicorn_http.c man
 	(git ls-files && for i in $@ $(pkg_extra); do echo $$i; done) | \
 	  LC_ALL=C sort > $@+
 	cmp $@+ $@ || mv $@+ $@
-- 
Eric Wong
_______________________________________________
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 28%]

* Re: "upstream timed out" after upgrades
  2010-02-04 14:22  0%         ` John-Paul Bader
@ 2010-02-04 15:11  0%           ` John-Paul Bader
  0 siblings, 0 replies; 20+ results
From: John-Paul Bader @ 2010-02-04 15:11 UTC (permalink / raw)
  To: unicorn list

To counter check I just built the latest ruby from source as well and the issue reappeared - so it happened between 26253 and tag/248

Kind regards, John

On 04.02.2010, at 15:22, John-Paul Bader wrote:

> Hey,
> 
> i checked out the revision 26253 built it and ran it and it seems to work again but: I didn't build it via FreeBSD ports so there might be a difference in configure / build options and I checked out the revision which included the change you suspect for causing the issue so I'm not sure if thats really helping us. Curling directly unicorn works without truncation and issues though.
> 
> Kind regards, John
> 
> On 04.02.2010, at 13:26, John-Paul Bader wrote:
> 
>> Hey again,
>> 
>> I will try to compile build the svn revision and let you know. I have to do some other work before that so I will report back in the evening (CEST / BERLIN) 
>> 
>> Thank you for helping out, kind regards,
>> 
>> John
>> 
>> On 04.02.2010, at 11:11, Eric Wong wrote:
>> 
>>> John-Paul Bader <hukl@h3q.com> wrote:
>>>> One more,
>>> 
>>> Hi,
>>> 
>>> About the exceptions, looks like you had '-d' (debug) instead of '-D'
>>> (daemonize) so it spewed every exception (even if trapped) to stderr.
>>> EAGAIN is common when dealing with non-blocking sockets.  Most of that
>>> is noise...
>>> 
>>> However the EINVAL in unicorn/http_response.rb is suspect.
>>> 
>>>> I reproduced the upgrading on my staging server which was still at the
>>>> old state in terms of software. I started by upgrading ruby from
>>>> 
>>>> ruby+nopthreads-1.8.7.160_5,1       -> ruby+nopthreads-1.8.7.248,1
>>>> ruby18-iconv-1.8.7.160,1                   -> ruby18-iconv-1.8.7.248,1
>>>> 
>>>> And voilá - the very same problems. So now I'm like what?
>>>> 
>>>> Is this rather a ruby than a unicorn issue ? Couldn't find any clues
>>>> in the changelog so far:
>>>> http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/tags/v1_8_7_248/ChangeLog
>>> 
>>> That should narrow it down, so I start reading diffs from
>>> v1_8_7_160..v1_8_7_248 ...
>>> 
>>> Does backporting the following change in ruby_1_8
>>> (but not yet in the ruby_1_8_7 branch) fix things for you?
>>> 
>>> commit 841a57341ed43f5fa86489c12aceb25a232be820
>>> Author: nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>
>>> Date:   Fri Jan 8 09:51:23 2010 +0000
>>> 
>>>  * io.c (io_fwrite): preserve errno.  [ruby-core:27425]
>>> 
>>> 
>>>  git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@26253
>>> 
>>> (snipped)
>>> 
>>> diff --git a/io.c b/io.c
>>> index 375cbc8..d4d28e5 100644
>>> --- a/io.c
>>> +++ b/io.c
>>> @@ -122,6 +122,9 @@ extern void Init_File _((void));
>>> # endif
>>> #endif
>>> 
>>> +#define preserving_errno(stmts) \
>>> +	do {int saved_errno = errno; stmts; errno = saved_errno;} while (0)
>>> +
>>> VALUE rb_cIO;
>>> VALUE rb_eEOFError;
>>> VALUE rb_eIOError;
>>> @@ -490,7 +493,7 @@ io_fwrite(str, fptr)
>>> 	r = write(fileno(f), RSTRING(str)->ptr+offset, l);
>>>       TRAP_END;
>>> #if BSD_STDIO
>>> -	fseeko(f, lseek(fileno(f), (off_t)0, SEEK_CUR), SEEK_SET);
>>> +	preserving_errno(fseeko(f, lseek(fileno(f), (off_t)0, SEEK_CUR), SEEK_SET));
>>> #endif
>>>       if (r == n) return len;
>>>       if (0 <= r) {
>>> ---
>>> Of course, the original reason for this fseeko() was to fix another
>>> problem Unicorn exposed when mixing stdio + unistd calls...
>>> 
>>> http://redmine.ruby-lang.org/issues/show/2267
>>> 
>>> -- 
>>> Eric Wong
>>> _______________________________________________
>>> 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
>> 
> 
> _______________________________________________
> 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: "upstream timed out" after upgrades
  2010-02-04 12:26  0%       ` John-Paul Bader
@ 2010-02-04 14:22  0%         ` John-Paul Bader
  2010-02-04 15:11  0%           ` John-Paul Bader
  0 siblings, 1 reply; 20+ results
From: John-Paul Bader @ 2010-02-04 14:22 UTC (permalink / raw)
  To: unicorn list

Hey,

i checked out the revision 26253 built it and ran it and it seems to work again but: I didn't build it via FreeBSD ports so there might be a difference in configure / build options and I checked out the revision which included the change you suspect for causing the issue so I'm not sure if thats really helping us. Curling directly unicorn works without truncation and issues though.

Kind regards, John

On 04.02.2010, at 13:26, John-Paul Bader wrote:

> Hey again,
> 
> I will try to compile build the svn revision and let you know. I have to do some other work before that so I will report back in the evening (CEST / BERLIN) 
> 
> Thank you for helping out, kind regards,
> 
> John
> 
> On 04.02.2010, at 11:11, Eric Wong wrote:
> 
>> John-Paul Bader <hukl@h3q.com> wrote:
>>> One more,
>> 
>> Hi,
>> 
>> About the exceptions, looks like you had '-d' (debug) instead of '-D'
>> (daemonize) so it spewed every exception (even if trapped) to stderr.
>> EAGAIN is common when dealing with non-blocking sockets.  Most of that
>> is noise...
>> 
>> However the EINVAL in unicorn/http_response.rb is suspect.
>> 
>>> I reproduced the upgrading on my staging server which was still at the
>>> old state in terms of software. I started by upgrading ruby from
>>> 
>>> ruby+nopthreads-1.8.7.160_5,1       -> ruby+nopthreads-1.8.7.248,1
>>> ruby18-iconv-1.8.7.160,1                   -> ruby18-iconv-1.8.7.248,1
>>> 
>>> And voilá - the very same problems. So now I'm like what?
>>> 
>>> Is this rather a ruby than a unicorn issue ? Couldn't find any clues
>>> in the changelog so far:
>>> http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/tags/v1_8_7_248/ChangeLog
>> 
>> That should narrow it down, so I start reading diffs from
>> v1_8_7_160..v1_8_7_248 ...
>> 
>> Does backporting the following change in ruby_1_8
>> (but not yet in the ruby_1_8_7 branch) fix things for you?
>> 
>> commit 841a57341ed43f5fa86489c12aceb25a232be820
>> Author: nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>
>> Date:   Fri Jan 8 09:51:23 2010 +0000
>> 
>>   * io.c (io_fwrite): preserve errno.  [ruby-core:27425]
>> 
>> 
>>   git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@26253
>> 
>> (snipped)
>> 
>> diff --git a/io.c b/io.c
>> index 375cbc8..d4d28e5 100644
>> --- a/io.c
>> +++ b/io.c
>> @@ -122,6 +122,9 @@ extern void Init_File _((void));
>> # endif
>> #endif
>> 
>> +#define preserving_errno(stmts) \
>> +	do {int saved_errno = errno; stmts; errno = saved_errno;} while (0)
>> +
>> VALUE rb_cIO;
>> VALUE rb_eEOFError;
>> VALUE rb_eIOError;
>> @@ -490,7 +493,7 @@ io_fwrite(str, fptr)
>> 	r = write(fileno(f), RSTRING(str)->ptr+offset, l);
>>        TRAP_END;
>> #if BSD_STDIO
>> -	fseeko(f, lseek(fileno(f), (off_t)0, SEEK_CUR), SEEK_SET);
>> +	preserving_errno(fseeko(f, lseek(fileno(f), (off_t)0, SEEK_CUR), SEEK_SET));
>> #endif
>>        if (r == n) return len;
>>        if (0 <= r) {
>> ---
>> Of course, the original reason for this fseeko() was to fix another
>> problem Unicorn exposed when mixing stdio + unistd calls...
>> 
>>  http://redmine.ruby-lang.org/issues/show/2267
>> 
>> -- 
>> Eric Wong
>> _______________________________________________
>> 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
> 

_______________________________________________
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: "upstream timed out" after upgrades
  2010-02-04 10:11  0%     ` Eric Wong
@ 2010-02-04 12:26  0%       ` John-Paul Bader
  2010-02-04 14:22  0%         ` John-Paul Bader
  0 siblings, 1 reply; 20+ results
From: John-Paul Bader @ 2010-02-04 12:26 UTC (permalink / raw)
  To: unicorn list

Hey again,

I will try to compile build the svn revision and let you know. I have to do some other work before that so I will report back in the evening (CEST / BERLIN) 

Thank you for helping out, kind regards,

John

On 04.02.2010, at 11:11, Eric Wong wrote:

> John-Paul Bader <hukl@h3q.com> wrote:
>> One more,
> 
> Hi,
> 
> About the exceptions, looks like you had '-d' (debug) instead of '-D'
> (daemonize) so it spewed every exception (even if trapped) to stderr.
> EAGAIN is common when dealing with non-blocking sockets.  Most of that
> is noise...
> 
> However the EINVAL in unicorn/http_response.rb is suspect.
> 
>> I reproduced the upgrading on my staging server which was still at the
>> old state in terms of software. I started by upgrading ruby from
>> 
>> ruby+nopthreads-1.8.7.160_5,1       -> ruby+nopthreads-1.8.7.248,1
>> ruby18-iconv-1.8.7.160,1                   -> ruby18-iconv-1.8.7.248,1
>> 
>> And voilá - the very same problems. So now I'm like what?
>> 
>> Is this rather a ruby than a unicorn issue ? Couldn't find any clues
>> in the changelog so far:
>> http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/tags/v1_8_7_248/ChangeLog
> 
> That should narrow it down, so I start reading diffs from
> v1_8_7_160..v1_8_7_248 ...
> 
> Does backporting the following change in ruby_1_8
> (but not yet in the ruby_1_8_7 branch) fix things for you?
> 
> commit 841a57341ed43f5fa86489c12aceb25a232be820
> Author: nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>
> Date:   Fri Jan 8 09:51:23 2010 +0000
> 
>    * io.c (io_fwrite): preserve errno.  [ruby-core:27425]
> 
> 
>    git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@26253
> 
>  (snipped)
> 
> diff --git a/io.c b/io.c
> index 375cbc8..d4d28e5 100644
> --- a/io.c
> +++ b/io.c
> @@ -122,6 +122,9 @@ extern void Init_File _((void));
> # endif
> #endif
> 
> +#define preserving_errno(stmts) \
> +	do {int saved_errno = errno; stmts; errno = saved_errno;} while (0)
> +
> VALUE rb_cIO;
> VALUE rb_eEOFError;
> VALUE rb_eIOError;
> @@ -490,7 +493,7 @@ io_fwrite(str, fptr)
> 	r = write(fileno(f), RSTRING(str)->ptr+offset, l);
>         TRAP_END;
> #if BSD_STDIO
> -	fseeko(f, lseek(fileno(f), (off_t)0, SEEK_CUR), SEEK_SET);
> +	preserving_errno(fseeko(f, lseek(fileno(f), (off_t)0, SEEK_CUR), SEEK_SET));
> #endif
>         if (r == n) return len;
>         if (0 <= r) {
> ---
> Of course, the original reason for this fseeko() was to fix another
> problem Unicorn exposed when mixing stdio + unistd calls...
> 
>   http://redmine.ruby-lang.org/issues/show/2267
> 
> -- 
> Eric Wong
> _______________________________________________
> 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: "upstream timed out" after upgrades
  2010-02-04  9:28  7%   ` John-Paul Bader
@ 2010-02-04 10:11  0%     ` Eric Wong
  2010-02-04 12:26  0%       ` John-Paul Bader
  0 siblings, 1 reply; 20+ results
From: Eric Wong @ 2010-02-04 10:11 UTC (permalink / raw)
  To: unicorn list

John-Paul Bader <hukl@h3q.com> wrote:
> One more,

Hi,

About the exceptions, looks like you had '-d' (debug) instead of '-D'
(daemonize) so it spewed every exception (even if trapped) to stderr.
EAGAIN is common when dealing with non-blocking sockets.  Most of that
is noise...

However the EINVAL in unicorn/http_response.rb is suspect.

> I reproduced the upgrading on my staging server which was still at the
> old state in terms of software. I started by upgrading ruby from
> 
> ruby+nopthreads-1.8.7.160_5,1       -> ruby+nopthreads-1.8.7.248,1
> ruby18-iconv-1.8.7.160,1                   -> ruby18-iconv-1.8.7.248,1
> 
> And voilá - the very same problems. So now I'm like what?
> 
> Is this rather a ruby than a unicorn issue ? Couldn't find any clues
> in the changelog so far:
> http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/tags/v1_8_7_248/ChangeLog

That should narrow it down, so I start reading diffs from
v1_8_7_160..v1_8_7_248 ...

Does backporting the following change in ruby_1_8
(but not yet in the ruby_1_8_7 branch) fix things for you?

commit 841a57341ed43f5fa86489c12aceb25a232be820
Author: nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>
Date:   Fri Jan 8 09:51:23 2010 +0000

    * io.c (io_fwrite): preserve errno.  [ruby-core:27425]
    
    
    git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@26253

  (snipped)

diff --git a/io.c b/io.c
index 375cbc8..d4d28e5 100644
--- a/io.c
+++ b/io.c
@@ -122,6 +122,9 @@ extern void Init_File _((void));
 # endif
 #endif
 
+#define preserving_errno(stmts) \
+	do {int saved_errno = errno; stmts; errno = saved_errno;} while (0)
+
 VALUE rb_cIO;
 VALUE rb_eEOFError;
 VALUE rb_eIOError;
@@ -490,7 +493,7 @@ io_fwrite(str, fptr)
 	r = write(fileno(f), RSTRING(str)->ptr+offset, l);
         TRAP_END;
 #if BSD_STDIO
-	fseeko(f, lseek(fileno(f), (off_t)0, SEEK_CUR), SEEK_SET);
+	preserving_errno(fseeko(f, lseek(fileno(f), (off_t)0, SEEK_CUR), SEEK_SET));
 #endif
         if (r == n) return len;
         if (0 <= r) {
---
Of course, the original reason for this fseeko() was to fix another
problem Unicorn exposed when mixing stdio + unistd calls...

   http://redmine.ruby-lang.org/issues/show/2267

-- 
Eric Wong
_______________________________________________
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 0%]

* Re: "upstream timed out" after upgrades
  @ 2010-02-04  9:28  7%   ` John-Paul Bader
  2010-02-04 10:11  0%     ` Eric Wong
  0 siblings, 1 reply; 20+ results
From: John-Paul Bader @ 2010-02-04  9:28 UTC (permalink / raw)
  To: unicorn list

One more,

I reproduced the upgrading on my staging server which was still at the old state in terms of software. I started by upgrading ruby from

ruby+nopthreads-1.8.7.160_5,1       -> ruby+nopthreads-1.8.7.248,1
ruby18-iconv-1.8.7.160,1                   -> ruby18-iconv-1.8.7.248,1

And voilá - the very same problems. So now I'm like what?

Is this rather a ruby than a unicorn issue ? Couldn't find any clues in the changelog so far: http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/tags/v1_8_7_248/ChangeLog

Kind regards, John
_______________________________________________
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: Our Unicorn Setup
  @ 2009-10-09 20:30  4% ` Eric Wong
  0 siblings, 0 replies; 20+ results
From: Eric Wong @ 2009-10-09 20:30 UTC (permalink / raw)
  To: Chris Wanstrath; +Cc: mongrel-unicorn

Chris Wanstrath <chris@ozmm.org> wrote:
> Hi list,
> 
> I've just published a post detailing our Unicorn setup, migration
> process, and reasons for choosing it:
> http://github.com/blog/517-unicorn

Cool!

"The Unicorn master manages the workers and balancing"

Actually, the master never manages balancing, just the workers.  The
diagram is a little inaccurate as it looks like the master sees the
requests, it never does.

The request flow is like this:

           requests
              |
              |
              |
        shared socket(s)
             /|\
            / | \
           |  |  |
           |  |  |
         worker pool

While the shared socket is opened and configured by the master, but the
master does nothing else with the sockets.  You're completely right
about the pull balancing, it's one of the most distinctive differences
between Unicorn and other setups.



Also, for the 502s, do you get more 502s after the initial worker times
out?  I think nginx may (still)[1] mark a backend as completely dead/down
when a backend dies.  That may cause nginx to stop forwarding to that
backend entirely and throw more 502s for a few seconds until nginx
decides to actually try that backend again.

Setting fail_timeout=0 causes nginx to never mark backends as down and
always try to send a request to them:

  upstream github {
    server unix:/data/github/current/tmp/sockets/unicorn.sock fail_timeout=0;
  }

I'll add this bit somewhere in the Unicorn docs and release 0.93.3 with
the OpenBSD fix for Jeremy in a bit.

> Thanks again!

No problem :)


[1] - I'm not 100% sure if nginx still does this, but I don't see
      anything in the 0.6.x changelog that indicates otherwise.
      I don't see a huge amount of harm in doing this always, we've been
      using fail_timeout=0 for ~2 years now regardless of the backend.

-- 
Eric Wong

^ permalink raw reply	[relevance 4%]

* draft release notes (so far) for upcoming 0.93.0
@ 2009-10-01  8:13  3% Eric Wong
  0 siblings, 0 replies; 20+ results
From: Eric Wong @ 2009-10-01  8:13 UTC (permalink / raw)
  To: mongrel-unicorn

The one minor bugfix is only for users who set RAILS_RELATIVE_URL_ROOT
in a config file.  Users of the "--path" switch or those who set the
environment variable in the shell were unaffected by this bug.  Note
that we still don't have relative URL root support for Rails < 2.3, and
are unlikely to bother with it unless there is visible demand for it.  I
didn't even know people used/cared for relative URL roots before today
(it was a Rails 2.3.4 user).

New features (so far) includes support for :tries and :delay when
specifying a "listen" in an after_fork hook.  This was inspired by Chris
Wanstrath's example of binding per-worker listen sockets in a loop while
migrating (or upgrading) Unicorn.  Setting a negative value for :tries
means we'll retry the listen indefinitely until the socket becomes
available.

So you can do something like this in an after_fork hook:

    after_fork do |server,worker|
      addr = "127.0.0.1:#{9293 + worker.nr}"
      server.listen(addr, :tries => -1, :delay => 5)
    end

There's also the usual round of added documentation, packaging fixes,
code cleanups and minor performance improvements that are viewable
in the git log....

Shortlog since v0.92.0 (so far) below:

Eric Wong (45):
      build: hardcode the canonical git URL
      build: manifest dropped manpages
      build: smaller ChangeLog
      doc/LATEST: remove trailing newline
      http: don't force -fPIC if it can't be used
      .gitignore on *.rbc files Rubinius generates
      README/gemspec: a better description, hopefully
      GNUmakefile: add missing .manifest dep on test installs
      Add HACKING document
      configurator: fix user switch example in RDoc
      local.mk.sample: time and perms enforcement
      unicorn_rails: show "RAILS_ENV" in help message
      gemspec: compatibility with older Rubygems
      Split out KNOWN_ISSUES document
      KNOWN_ISSUES: add notes about the "isolate" gem
      gemspec: fix test_files regexp match
      gemspec: remove tests that fork from test_files
      test_signals: ensure we can parse pids in response
      GNUmakefile: cleanup test/manifest generation
      util: remove APPEND_FLAGS constant
      http_request: simplify and remove handle_body method
      http_response: simplify and remove const dependencies
      local.mk.sample: fix .js times
      TUNING: notes about benchmarking a high :backlog
      HttpServer#listen accepts :tries and :delay parameters
      "make install" avoids installing multiple .so objects
      Use Configurator#expand_addr in HttpServer#listen
      configurator: move initialization stuff to #initialize
      Remove "Z" constant for binary strings
      cgi_wrapper: don't warn about stdoutput usage
      cgi_wrapper: simplify status handling in response
      cgi_wrapper: use Array#concat instead of +=
      server: correctly unset reexec_pid on child death
      configurator: update and modernize examples
      configurator: add colons in front of listen() options
      configurator: remove DEFAULT_LOGGER constant
      gemspec: clarify commented-out licenses section
      Add makefile targets for non-release installs
      cleanup: use question mark op for 1-byte comparisons
      RDoc for Unicorn::HttpServer::Worker
      small cleanup to pid file handling + documentation
      rails: RAILS_RELATIVE_URL_ROOT may be set in Unicorn config
      unicorn_rails: undeprecate --path switch
      manpages: document environment variables
      README: remove reference to different versions

-- 
Eric Wong

^ permalink raw reply	[relevance 3%]

* [ANN] unicorn 0.92.0
@ 2009-09-18 22:16  3% Eric Wong
  0 siblings, 0 replies; 20+ results
From: Eric Wong @ 2009-09-18 22:16 UTC (permalink / raw)
  To: mongrel-unicorn

Unicorn is a Rack HTTP server for Unix and fast clients

Small fixes and documentation are the focus of this release.

James Golick reported and helped me track down a bug that caused
SIGHUP to drop the default listener (0.0.0.0:8080) if and only
if listeners were completely unspecified in both the
command-line and Unicorn config file.  The Unicorn config file
remains the recommended option for specifying listeners as it
allows fine-tuning of the :backlog, :rcvbuf, :sndbuf,
:tcp_nopush, and :tcp_nodelay options.

There are some documentation (and resulting website)
improvements.  setup.rb users will notice the new section 1
manpages for `unicorn` and `unicorn_rails`, Rubygems users
will have to install manpages manually or use the website.

  Edit: That's not entirely true, I screwed up the package but
  you can get them from http://unicorn.bogomips.org/unicorn.1
  and http://unicorn.bogomips.org/unicorn_rails.1

The HTTP parser got a 3rd-party code review which resulted in
some cleanups and one insignificant bugfix as a result.

Additionally, the HTTP parser compiles, runs and passes unit
tests under Rubinius.  The pure-Ruby parts still do not work yet
and we currently lack the resources/interest to pursue this
further but help will be gladly accepted.

The website now has an Atom feed for new release announcements.
Those unfamiliar with Atom or HTTP may finger unicorn@bogomips.org
for the latest announcements.

Eric Wong (53):
      README: update with current version
      http: cleanup and avoid potential signedness warning
      http: clarify the setting of the actual header in the hash
      http: switch to macros for bitflag handling
      http: refactor keepalive tracking to functions
      http: use explicit elses for readability
      http: remove needless goto
      http: extra assertion when advancing p manually
      http: verbose assertions
      http: NIL_P(var) instead of var == Qnil
      http: rb_gc_mark already ignores immediates
      http: ignore Host: continuation lines with absolute URIs
      doc/SIGNALS: fix the no-longer-true bit about socket options
      "encoding: binary" comments for all sources (1.9)
      http_response: don't "rescue nil" for body.close
      CONTRIBUTORS: fix capitalization for why
      http: support Rubies without the OBJ_FROZEN macro
      http: define OFFT2NUM macro on Rubies without it
      http: no-op rb_str_modify() for Rubies without it
      http: compile with -fPIC
      http: use rb_str_{update,flush} if available
      http: create a new string buffer on empty values
      Update documentation for Rubinius support status
      http: cleanup assertion for memoized header strings
      http: add #endif comment labels where appropriate
      Add .mailmap file for "git shortlog" and other tools
      Update Manifest with mailmap
      Fix comment about speculative accept()
      SIGNALS: use "Unicorn" when referring to the web server
      Add new Documentation section for manpages
      test_exec: add extra tests for HUP and preload_app
      socket_helper: (FreeBSD) don't freeze the accept filter constant
      Avoid freezing objects that don't benefit from it
      SIGHUP no longer drops lone, default listener
      doc: generate ChangeLog and NEWS file for RDoc
      Remove Echoe and roll our own packaging/release...
      unicorn_rails: close parentheses in help message
      launchers: deprecate ambiguous -P/--p* switches
      man1/unicorn: avoid unnecessary emphasis
      Add unicorn_rails(1) manpage
      Documentation: don't force --rsyncable flag with gzip(1)
      Simplify and standardize manpages build/install
      GNUmakefile: package .tgz includes all generated files
      doc: begin integration of HTML manpages into RDoc
      Update TODO
      html: add Atom feeds
      doc: latest news is available through finger
      NEWS.atom: file timestamp matches latest entry
      pandoc needs the standalone switch for manpages
      man1/unicorn: split out RACK ENVIRONMENT section
      man1/unicorn_rails: fix unescaped underscore
      NEWS.atom.xml only lists the first 10 entries
      unicorn 0.92.0

* site: http://unicorn.bogomips.org/
* git: git://git.bogomips.org/unicorn.git
* cgit: http://git.bogomips.org/cgit/unicorn.git/
* list: mongrel-unicorn@rubyforge.org
* nntp: nntp://news.gmane.org/gmane.comp.lang.ruby.unicorn.general
* finger: unicorn@bogomips.org

-- 
Eric Wong

^ permalink raw reply	[relevance 3%]

* merging Unicorn HTTP parser back to Mongrel
@ 2009-09-05 21:50  2% Eric Wong
  0 siblings, 0 replies; 20+ results
From: Eric Wong @ 2009-09-05 21:50 UTC (permalink / raw)
  To: mongrel-development; +Cc: mongrel-unicorn

Hello,  (ok, this email got longer than expected, I now consider the
most important parts the first and last paragraphs of the last
footnote).

The Unicorn HTTP parser is feature complete as far as I can tell and
supports things the Mongrel one does not.  I would very much like to see
it used in places that Unicorn isn't suited for[1].  In fact, a chunk of
the new features are much better suited for a server with better slow
client handling like Mongrel.

The big roadblock to getting this back into Mongrel is the Java/JRuby
version of the parser Mongrel uses.  Simply put, I don't do Java;
somebody else will have to port it.  But I'll have to convince you
that these features are worth going into Mongrel, too :)

I could provide a standalone C parser that can be wrapped with FFI, but
I'm not sure if the performance would be acceptable.  I'm fairly certain
that a pure-Ruby version with Ragel-generated code would not provide
acceptable performance anywhere; maybe a hand-coded one could, but I'm
not particularly excited about doing that...

The MRI-C parser should just work on Win32.

Unlike the rest of Unicorn, the HTTP parser remains portable to non-UNIX
platforms and thread-safe.  There are no system-calls made directly
through it (only memory allocations through the Ruby C API).


New features that aren't in Mongrel are:

* HTTP/0.9 support - blame a network BOFH hell bent for hell on saving
  bytes with a health-checker config for this :)

  The HttpParser#headers?  method has been added to determine if headers
  should be sent in the response (HTTP/0.9 didn't have response
  headers).

* "Transfer-Encoding: chunked" request decoding support
  I've been told mobile devices[2] do uploads like this (since they
  may lack the storage capacity to store large files).  This will be
  useful to Mongrel since Mongrel can handle slow clients better
  (mobile devices).

  I also have a use case that goes like this:

    tar zc $BIG_DIRECTORY | curl -T- http://unicorn/path/to/upload

  This designed to be slurp-resistant so clients cannot control memory
  usage of the server and DoS it even with huge chunk sizes.

* Trailers support (with Transfer-Encoding: chunked).  I haven't
  run across applications that use this yet (Amazon S3 maybe?) but one
  use case that I can forsee is generating a Content-MD5 trailer with
  the above "tar | curl" command.

* Multiline continuation headers - Pound sends them, I don't care for
  Pound but I figured I might as well do it just in case somebody else
  starts doing it...

* Absolute Request URI parsing - It was done with URI.parse
  originally, I figured I might as well do it in Ragel since it's part
  of rfc 2616.  I think client-side proxies use it so maybe one day
  somebody can turn Mongrel or a derived server into a client-side
  HTTP proxy...

* Repeated headers handling - they're joined with commas now since Rack
  doesn't accept arrays in HTTP_* entries .  I posted
  a standlone patch for this in <20090810001022.GA17572@dcvr.yhbt.net>

* HttpParser#keepalive? method - the parser can tell you if it's safe
  to handle a keepalive request.  Not used with Unicorn at the moment.

Chunk extensions is one thing that the parser currently just ignores,
this is because I've yet to see any use of them anywhere and Rack
does not mention them..

Parser Limits:

  Request body handling:

    Maximum Content-Length is the maximum value of off_t.  I don't think
    this should be a problem for anyone as Ruby defaults to
    _FILE_OFFSET_BITS=64 on 32-bit arches.  Mongrel does not have this
    limit in the parser, but since it buffers large uploads to a
    Tempfile, the limit always existed anyways.

    Maximum chunk size is also the maximum value of off_t, which is
    usually a 64-bit long (since Ruby defaults to _FILE_OFFSET_BITS=64
    on my 32-bit boxes).   I don't expect valid clients to send any
    values close to this limit, but that's just what it is.

  Headers:

    Mostly the same as Mongrel, all headers must fit into the same
    <=112K string object; which shouldn't be a problem for anything
    capable of running Ruby.

    Continuation lines can bypass the per-header size limit, but
    everything still stays under 112K which is a pretty large limit.

  Trailers:

    These can fit into another <=112K string, space taken up during
    header processing doesn't affect Trailer processing, so you could
    end up with 224K of combined metadata.


You can get a full changelog since I branched from fauna/mongrel via:

  git log v0.0.0.. -- ext

Finally, the new API is documented via RDoc here:

  http://unicorn.bogomips.org/Unicorn/HttpParser.html

  I don't consider the API set in stone, but I do consider the header
  handling part a bit simpler/less error prone than the old one.

Disclaimer:

  Due to the large amounts of changes to the C/Ragel portions, another
  security audit/pair-of-eyes would be nice.  All use of Unicorn so far
  has been on LANs with trusted clients or with nginx in front.  While
  I'm very comfortable with C and fairly comfortable with Ragel, I'm far
  from infallible so close review from a second pair of eyes would be
  greatly appreciated.

Future:

  I'm also planning on porting this to Rubinius, too. I haven't had a
  chance to look at it yet but the Mongrel/C one has already been ported
  so it shouldn't be too hard (I only know/can stomach a small amount of
  C++, though I suspect I won't even need it ...)

Footnotes:

[1] - Comet/long-polling/reverse HTTP, and sites that rely heavily on
      external services (including OpenID) are all badly suited for
      Unicorn.

[2] - As a side effect, Unicorn also uses a TeeInput class that allows
      the request body to be read in real-time within the Rack
      application (while "tee-ing" to a temporary file to provide
      rewindability).  This also allows Mongrel Upload Progress to
      be implemented in the future in a Rack::Lint-compliant manner.

      The one weird thing about TeeInput is that:

         env["rack.input"].read(NR_BYTES)

      Is not guaranteed to return NR_BYTES, only NR_BYTES at most.  So
      every #read can provide "last block" semantics.  Rack does not
      enforce this behavior, so it should be fine. This should not be a
      problem in practice since most read() and read()-like APIs provide
      no such guarantee even if implied when reading from "fast" devices
      like the filesystem.  CGI apps that get a socket as stdin also
      got similar semantics as what apps under Unicorn get.

      I imagine this feature to be hugely useful for slow mobile clients
      that stream data slowly as it allows the server to start processing
      data as it is being uploaded.

-- 
Eric Wong

^ permalink raw reply	[relevance 2%]

Results 1-20 of 20 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2009-09-05 21:50  2% merging Unicorn HTTP parser back to Mongrel Eric Wong
2009-09-18 22:16  3% [ANN] unicorn 0.92.0 Eric Wong
2009-10-01  8:13  3% draft release notes (so far) for upcoming 0.93.0 Eric Wong
2009-10-09 19:42     Our Unicorn Setup Chris Wanstrath
2009-10-09 20:30  4% ` Eric Wong
2010-02-04  8:16     "upstream timed out" after upgrades John-Paul Bader
2010-02-04  8:48     ` John-Paul Bader
2010-02-04  9:28  7%   ` John-Paul Bader
2010-02-04 10:11  0%     ` Eric Wong
2010-02-04 12:26  0%       ` John-Paul Bader
2010-02-04 14:22  0%         ` John-Paul Bader
2010-02-04 15:11  0%           ` John-Paul Bader
2011-06-06 17:31     [PATCH] Ensure that 'make gem' builds the documentation too Hongli Lai
2011-06-06 17:51 28% ` Eric Wong
2011-06-29  7:29  5% [ANN] unicorn 4.0.0.2.g19f7 prerelease Eric Wong
2012-04-27 22:00  5% [ANN] unicorn 4.3.0.2.g4551 gem prerelease Eric Wong
2012-11-14  2:42     .manifest file? mike
2012-11-14  3:00  5% ` Eric Wong
2013-02-08 13:54     Unicorn 4.6.0 version is 4.5.0 Maurizio De Santis
2013-02-08 18:55 14% ` [PATCH] auto-generate Unicorn::Const::UNICORN_VERSION Eric Wong
2013-11-25  6:01 12% permissions on ChangeLog and NEWS Ken Dreyer
2013-11-25  6:52  7% ` Eric Wong
2014-09-22  1:05     [PATCH 0/4] a few more minor cleanups pushed out Eric Wong
2014-09-22  1:05  9% ` [PATCH 1/4] remove RubyForge and Freecode references Eric Wong
2016-11-07 17:13  4% Build error of 5.1.0 due to RString Olivier FAURAX
2022-12-09 21:52  6% Support for Rack 3 headers formatted as arrays Martin Posthumus
2022-12-10  2:42  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).