unicorn 4.6.0pre1 → 4.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Documentation/unicorn.1.txt +8 -4
- data/GIT-VERSION-GEN +1 -1
- data/t/t0000-http-basic.sh +1 -1
- data/t/t0004-heartbeat-timeout.sh +3 -3
- data/t/t0006-reopen-logs.sh +4 -4
- data/t/t0019-max_header_len.sh +1 -1
- data/t/t0100-rack-input-tests.sh +10 -10
- data/t/t9000-preread-input.sh +2 -2
- data/t/test-lib.sh +16 -1
- metadata +5 -6
- data/t/bin/utee +0 -12
    
        data/Documentation/unicorn.1.txt
    CHANGED
    
    | @@ -61,6 +61,10 @@ with rackup(1) but strongly discouraged. | |
| 61 61 | 
             
                For production deployments, specifying the "listen" directive in
         | 
| 62 62 | 
             
                CONFIG_FILE is recommended as it allows fine-tuning of socket
         | 
| 63 63 | 
             
                options.
         | 
| 64 | 
            +
            -N, \--no-default-middleware
         | 
| 65 | 
            +
            :   Disables loading middleware implied by RACK_ENV.  This bypasses the
         | 
| 66 | 
            +
                configuration documented in the RACK ENVIRONMENT section, but still
         | 
| 67 | 
            +
                allows RACK_ENV to be used for application/framework-specific purposes.
         | 
| 64 68 |  | 
| 65 69 | 
             
            # RACKUP COMPATIBILITY OPTIONS
         | 
| 66 70 | 
             
            -o, \--host HOST
         | 
| @@ -144,10 +148,10 @@ As of Unicorn 0.94.0, RACK_ENV is exported as a process-wide environment | |
| 144 148 | 
             
            variable as well.  While not current a part of the Rack specification as
         | 
| 145 149 | 
             
            of Rack 1.0.1, this has become a de facto standard in the Rack world.
         | 
| 146 150 |  | 
| 147 | 
            -
            Note  | 
| 148 | 
            -
             | 
| 149 | 
            -
            individually specified in the | 
| 150 | 
            -
            not require them.
         | 
| 151 | 
            +
            Note the Rack::ContentLength and Rack::Chunked middlewares are also
         | 
| 152 | 
            +
            loaded by "deployment" and "development", but no other values of
         | 
| 153 | 
            +
            RACK_ENV.  If needed, they must be individually specified in the
         | 
| 154 | 
            +
            RACKUP_FILE, some frameworks do not require them.
         | 
| 151 155 |  | 
| 152 156 | 
             
            # ENVIRONMENT VARIABLES
         | 
| 153 157 |  | 
    
        data/GIT-VERSION-GEN
    CHANGED
    
    
    
        data/t/t0000-http-basic.sh
    CHANGED
    
    
| @@ -23,9 +23,9 @@ t_begin "sleep for a bit, ensure worker PID does not change" && { | |
| 23 23 |  | 
| 24 24 | 
             
            t_begin "block the worker process to force it to die" && {
         | 
| 25 25 | 
             
            	rm $ok
         | 
| 26 | 
            -
            	t0=$( | 
| 26 | 
            +
            	t0=$(unix_time)
         | 
| 27 27 | 
             
            	err="$(curl -sSf http://$listen/block-forever 2>&1 || > $ok)"
         | 
| 28 | 
            -
            	t1=$( | 
| 28 | 
            +
            	t1=$(unix_time)
         | 
| 29 29 | 
             
            	elapsed=$(($t1 - $t0))
         | 
| 30 30 | 
             
            	t_info "elapsed=$elapsed err=$err"
         | 
| 31 31 | 
             
            	test x"$err" != x"Should never get here"
         | 
| @@ -34,7 +34,7 @@ t_begin "block the worker process to force it to die" && { | |
| 34 34 |  | 
| 35 35 | 
             
            t_begin "ensure worker was killed" && {
         | 
| 36 36 | 
             
            	test -e $ok
         | 
| 37 | 
            -
            	test 1 -eq $(grep timeout $r_err | grep killing |  | 
| 37 | 
            +
            	test 1 -eq $(grep timeout $r_err | grep killing | count_lines)
         | 
| 38 38 | 
             
            }
         | 
| 39 39 |  | 
| 40 40 | 
             
            t_begin "ensure timeout took at least 3 seconds" && {
         | 
    
        data/t/t0006-reopen-logs.sh
    CHANGED
    
    | @@ -62,11 +62,11 @@ t_begin "rotated stderr is clean" && { | |
| 62 62 | 
             
            }
         | 
| 63 63 |  | 
| 64 64 | 
             
            t_begin "server is now writing logs to new stderr" && {
         | 
| 65 | 
            -
            	before_rot=$( | 
| 66 | 
            -
            	before_err=$( | 
| 65 | 
            +
            	before_rot=$(count_bytes < $r_rot)
         | 
| 66 | 
            +
            	before_err=$(count_bytes < $r_err)
         | 
| 67 67 | 
             
            	test xtrue = x$(curl -sSf http://$listen/ 2> $curl_err)
         | 
| 68 | 
            -
            	after_rot=$( | 
| 69 | 
            -
            	after_err=$( | 
| 68 | 
            +
            	after_rot=$(count_bytes < $r_rot)
         | 
| 69 | 
            +
            	after_err=$(count_bytes < $r_err)
         | 
| 70 70 | 
             
            	test $after_rot -eq $before_rot
         | 
| 71 71 | 
             
            	test $after_err -gt $before_err
         | 
| 72 72 | 
             
            }
         | 
    
        data/t/t0019-max_header_len.sh
    CHANGED
    
    | @@ -5,7 +5,7 @@ t_plan 5 "max_header_len setting (only intended for Rainbows!)" | |
| 5 5 | 
             
            t_begin "setup and start" && {
         | 
| 6 6 | 
             
            	unicorn_setup
         | 
| 7 7 | 
             
            	req='GET / HTTP/1.0\r\n\r\n'
         | 
| 8 | 
            -
            	len=$(printf "$req" |  | 
| 8 | 
            +
            	len=$(printf "$req" | count_bytes)
         | 
| 9 9 | 
             
            	echo Unicorn::HttpParser.max_header_len = $len >> $unicorn_config
         | 
| 10 10 | 
             
            	unicorn -D -c $unicorn_config env.ru
         | 
| 11 11 | 
             
            	unicorn_wait_start
         | 
    
        data/t/t0100-rack-input-tests.sh
    CHANGED
    
    | @@ -8,9 +8,9 @@ t_begin "setup and startup" && { | |
| 8 8 | 
             
            	rtmpfiles curl_out curl_err
         | 
| 9 9 | 
             
            	unicorn_setup
         | 
| 10 10 | 
             
            	unicorn -E none -D rack-input-tests.ru -c $unicorn_config
         | 
| 11 | 
            -
             | 
| 12 | 
            -
            	blob_size=$( | 
| 13 | 
            -
             | 
| 11 | 
            +
            	blob_sha1=$(rsha1 < random_blob)
         | 
| 12 | 
            +
            	blob_size=$(count_bytes < random_blob)
         | 
| 13 | 
            +
            	t_info "blob_sha1=$blob_sha1"
         | 
| 14 14 | 
             
            	unicorn_wait_start
         | 
| 15 15 | 
             
            }
         | 
| 16 16 |  | 
| @@ -24,7 +24,7 @@ t_begin "corked identity request" && { | |
| 24 24 | 
             
            		wait
         | 
| 25 25 | 
             
            		echo ok > $ok
         | 
| 26 26 | 
             
            	) | ( sleep 1 && socat - TCP4:$listen > $fifo )
         | 
| 27 | 
            -
            	test 1 -eq $(grep $blob_sha1 $tmp | | 
| 27 | 
            +
            	test 1 -eq $(grep $blob_sha1 $tmp |count_lines)
         | 
| 28 28 | 
             
            	test x"$(cat $ok)" = xok
         | 
| 29 29 | 
             
            }
         | 
| 30 30 |  | 
| @@ -36,7 +36,7 @@ t_begin "corked chunked request" && { | |
| 36 36 | 
             
            		wait
         | 
| 37 37 | 
             
            		echo ok > $ok
         | 
| 38 38 | 
             
            	) | ( sleep 1 && socat - TCP4:$listen > $fifo )
         | 
| 39 | 
            -
            	test 1 -eq $(grep $blob_sha1 $tmp | | 
| 39 | 
            +
            	test 1 -eq $(grep $blob_sha1 $tmp |count_lines)
         | 
| 40 40 | 
             
            	test x"$(cat $ok)" = xok
         | 
| 41 41 | 
             
            }
         | 
| 42 42 |  | 
| @@ -50,7 +50,7 @@ t_begin "corked identity request (input#size first)" && { | |
| 50 50 | 
             
            		wait
         | 
| 51 51 | 
             
            		echo ok > $ok
         | 
| 52 52 | 
             
            	) | ( sleep 1 && socat - TCP4:$listen > $fifo )
         | 
| 53 | 
            -
            	test 1 -eq $(grep $blob_sha1 $tmp | | 
| 53 | 
            +
            	test 1 -eq $(grep $blob_sha1 $tmp |count_lines)
         | 
| 54 54 | 
             
            	test x"$(cat $ok)" = xok
         | 
| 55 55 | 
             
            }
         | 
| 56 56 |  | 
| @@ -64,7 +64,7 @@ t_begin "corked identity request (input#rewind first)" && { | |
| 64 64 | 
             
            		wait
         | 
| 65 65 | 
             
            		echo ok > $ok
         | 
| 66 66 | 
             
            	) | ( sleep 1 && socat - TCP4:$listen > $fifo )
         | 
| 67 | 
            -
            	test 1 -eq $(grep $blob_sha1 $tmp | | 
| 67 | 
            +
            	test 1 -eq $(grep $blob_sha1 $tmp |count_lines)
         | 
| 68 68 | 
             
            	test x"$(cat $ok)" = xok
         | 
| 69 69 | 
             
            }
         | 
| 70 70 |  | 
| @@ -81,8 +81,8 @@ t_begin "corked chunked request (input#size first)" && { | |
| 81 81 | 
             
            		wait
         | 
| 82 82 | 
             
            		echo ok > $ok
         | 
| 83 83 | 
             
            	) | ( sleep 1 && socat - TCP4:$listen > $fifo )
         | 
| 84 | 
            -
            	test 1 -eq $(grep $blob_sha1 $tmp | | 
| 85 | 
            -
            	test 1 -eq $(grep $blob_sha1 $tmp | | 
| 84 | 
            +
            	test 1 -eq $(grep $blob_sha1 $tmp |count_lines)
         | 
| 85 | 
            +
            	test 1 -eq $(grep $blob_sha1 $tmp |count_lines)
         | 
| 86 86 | 
             
            	test x"$(cat $ok)" = xok
         | 
| 87 87 | 
             
            }
         | 
| 88 88 |  | 
| @@ -99,7 +99,7 @@ t_begin "corked chunked request (input#rewind first)" && { | |
| 99 99 | 
             
            		wait
         | 
| 100 100 | 
             
            		echo ok > $ok
         | 
| 101 101 | 
             
            	) | ( sleep 1 && socat - TCP4:$listen > $fifo )
         | 
| 102 | 
            -
            	test 1 -eq $(grep $blob_sha1 $tmp | | 
| 102 | 
            +
            	test 1 -eq $(grep $blob_sha1 $tmp |count_lines)
         | 
| 103 103 | 
             
            	test x"$(cat $ok)" = xok
         | 
| 104 104 | 
             
            }
         | 
| 105 105 |  | 
    
        data/t/t9000-preread-input.sh
    CHANGED
    
    | @@ -26,7 +26,7 @@ t_begin "sha1 matches" && { | |
| 26 26 | 
             
            }
         | 
| 27 27 |  | 
| 28 28 | 
             
            t_begin "app only dispatched twice" && {
         | 
| 29 | 
            -
            	test 2 -eq "$(grep 'app dispatch:' < $r_err |  | 
| 29 | 
            +
            	test 2 -eq "$(grep 'app dispatch:' < $r_err | count_lines )"
         | 
| 30 30 | 
             
            }
         | 
| 31 31 |  | 
| 32 32 | 
             
            t_begin "aborted chunked request" && {
         | 
| @@ -38,7 +38,7 @@ t_begin "aborted chunked request" && { | |
| 38 38 | 
             
            }
         | 
| 39 39 |  | 
| 40 40 | 
             
            t_begin "app only dispatched twice" && {
         | 
| 41 | 
            -
            	test 2 -eq "$(grep 'app dispatch:' < $r_err |  | 
| 41 | 
            +
            	test 2 -eq "$(grep 'app dispatch:' < $r_err | count_lines )"
         | 
| 42 42 | 
             
            }
         | 
| 43 43 |  | 
| 44 44 | 
             
            t_begin "killing succeeds" && {
         | 
    
        data/t/test-lib.sh
    CHANGED
    
    | @@ -32,6 +32,21 @@ wait_for_pid () { | |
| 32 32 | 
             
            	done
         | 
| 33 33 | 
             
            }
         | 
| 34 34 |  | 
| 35 | 
            +
            # "unix_time" is not in POSIX, but in GNU, and FreeBSD 9.0 (possibly earlier)
         | 
| 36 | 
            +
            unix_time () {
         | 
| 37 | 
            +
            	$RUBY -e 'puts Time.now.to_i'
         | 
| 38 | 
            +
            }
         | 
| 39 | 
            +
             | 
| 40 | 
            +
            # "wc -l" outputs leading whitespace on *BSDs, filter it out for portability
         | 
| 41 | 
            +
            count_lines () {
         | 
| 42 | 
            +
            	wc -l | tr -d '[:space:]'
         | 
| 43 | 
            +
            }
         | 
| 44 | 
            +
             | 
| 45 | 
            +
            # "wc -c" outputs leading whitespace on *BSDs, filter it out for portability
         | 
| 46 | 
            +
            count_bytes () {
         | 
| 47 | 
            +
            	wc -c | tr -d '[:space:]'
         | 
| 48 | 
            +
            }
         | 
| 49 | 
            +
             | 
| 35 50 | 
             
            # given a list of variable names, create temporary files and assign
         | 
| 36 51 | 
             
            # the pathnames to those variables
         | 
| 37 52 | 
             
            rtmpfiles () {
         | 
| @@ -49,7 +64,7 @@ rtmpfiles () { | |
| 49 64 | 
             
            			;;
         | 
| 50 65 | 
             
            		*socket)
         | 
| 51 66 | 
             
            			_tmp="$(mktemp -t $id.$$.XXXXXXXX)"
         | 
| 52 | 
            -
            			if test $(printf "$_tmp" | | 
| 67 | 
            +
            			if test $(printf "$_tmp" |count_bytes) -gt 108
         | 
| 53 68 | 
             
            			then
         | 
| 54 69 | 
             
            				echo >&2 "$_tmp too long, tests may fail"
         | 
| 55 70 | 
             
            				echo >&2 "Try to set TMPDIR to a shorter path"
         | 
    
        metadata
    CHANGED
    
    | @@ -2,15 +2,15 @@ | |
| 2 2 | 
             
            name: !binary |-
         | 
| 3 3 | 
             
              dW5pY29ybg==
         | 
| 4 4 | 
             
            version: !ruby/object:Gem::Version
         | 
| 5 | 
            -
              version: 4.6. | 
| 6 | 
            -
              prerelease:  | 
| 5 | 
            +
              version: 4.6.0
         | 
| 6 | 
            +
              prerelease: 
         | 
| 7 7 | 
             
            platform: ruby
         | 
| 8 8 | 
             
            authors:
         | 
| 9 9 | 
             
            - Unicorn hackers
         | 
| 10 10 | 
             
            autorequire: 
         | 
| 11 11 | 
             
            bindir: bin
         | 
| 12 12 | 
             
            cert_chain: []
         | 
| 13 | 
            -
            date: 2013- | 
| 13 | 
            +
            date: 2013-02-06 00:00:00.000000000 Z
         | 
| 14 14 | 
             
            dependencies:
         | 
| 15 15 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 16 16 | 
             
              name: !binary |-
         | 
| @@ -250,7 +250,6 @@ files: | |
| 250 250 | 
             
            - t/bin/content-md5-put
         | 
| 251 251 | 
             
            - t/bin/sha1sum.rb
         | 
| 252 252 | 
             
            - t/bin/unused_listen
         | 
| 253 | 
            -
            - t/bin/utee
         | 
| 254 253 | 
             
            - t/broken-app.ru
         | 
| 255 254 | 
             
            - t/detach.ru
         | 
| 256 255 | 
             
            - t/env.ru
         | 
| @@ -351,9 +350,9 @@ required_ruby_version: !ruby/object:Gem::Requirement | |
| 351 350 | 
             
            required_rubygems_version: !ruby/object:Gem::Requirement
         | 
| 352 351 | 
             
              none: false
         | 
| 353 352 | 
             
              requirements:
         | 
| 354 | 
            -
              - - ! ' | 
| 353 | 
            +
              - - ! '>='
         | 
| 355 354 | 
             
                - !ruby/object:Gem::Version
         | 
| 356 | 
            -
                  version:  | 
| 355 | 
            +
                  version: '0'
         | 
| 357 356 | 
             
            requirements: []
         | 
| 358 357 | 
             
            rubyforge_project: !binary |-
         | 
| 359 358 | 
             
              bW9uZ3JlbA==
         | 
    
        data/t/bin/utee
    DELETED
    
    | @@ -1,12 +0,0 @@ | |
| 1 | 
            -
            #!/usr/bin/env ruby
         | 
| 2 | 
            -
            # -*- encoding: binary -*-
         | 
| 3 | 
            -
            # tee(1) as distributed on most(all?) systems is buffered in luserspace
         | 
| 4 | 
            -
            # this only does unbuffered writes (with line-buffered input) to make
         | 
| 5 | 
            -
            # test output appear in real-time
         | 
| 6 | 
            -
            $stdin.binmode
         | 
| 7 | 
            -
            $stdout.binmode
         | 
| 8 | 
            -
            fp = File.open(ARGV.shift, "wb")
         | 
| 9 | 
            -
            $stdin.each_line do |line|
         | 
| 10 | 
            -
              fp.syswrite line
         | 
| 11 | 
            -
              $stdout.syswrite line
         | 
| 12 | 
            -
            end
         |