unicorn 4.9.0 → 6.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.gitattributes +5 -0
- data/.manifest +14 -15
- data/.olddoc.yml +16 -6
- data/Application_Timeouts +7 -7
- data/CONTRIBUTORS +6 -2
- data/DESIGN +2 -4
- data/Documentation/.gitignore +1 -3
- data/Documentation/unicorn.1 +222 -0
- data/Documentation/unicorn_rails.1 +207 -0
- data/FAQ +17 -8
- data/GIT-VERSION-FILE +1 -1
- data/GIT-VERSION-GEN +1 -1
- data/GNUmakefile +121 -56
- data/HACKING +2 -10
- data/ISSUES +40 -43
- data/KNOWN_ISSUES +11 -11
- data/LATEST +16 -22
- data/LICENSE +2 -2
- data/Links +24 -25
- data/NEWS +771 -0
- data/PHILOSOPHY +0 -6
- data/README +46 -40
- data/SIGNALS +2 -2
- data/Sandbox +11 -10
- data/TODO +0 -2
- data/TUNING +30 -9
- data/archive/slrnpull.conf +1 -1
- data/bin/unicorn +4 -2
- data/bin/unicorn_rails +3 -3
- data/examples/big_app_gc.rb +1 -1
- data/examples/init.sh +36 -8
- data/examples/logrotate.conf +17 -2
- data/examples/nginx.conf +14 -14
- data/examples/unicorn.conf.minimal.rb +2 -2
- data/examples/unicorn.conf.rb +3 -6
- data/examples/unicorn.socket +11 -0
- data/examples/unicorn@.service +40 -0
- data/ext/unicorn_http/c_util.h +5 -13
- data/ext/unicorn_http/common_field_optimization.h +22 -5
- data/ext/unicorn_http/epollexclusive.h +124 -0
- data/ext/unicorn_http/ext_help.h +0 -44
- data/ext/unicorn_http/extconf.rb +32 -5
- data/ext/unicorn_http/global_variables.h +2 -2
- data/ext/unicorn_http/httpdate.c +3 -2
- data/ext/unicorn_http/unicorn_http.c +926 -638
- data/ext/unicorn_http/unicorn_http.rl +159 -170
- data/ext/unicorn_http/unicorn_http_common.rl +1 -1
- data/lib/unicorn/configurator.rb +110 -44
- data/lib/unicorn/const.rb +2 -25
- data/lib/unicorn/http_request.rb +110 -31
- data/lib/unicorn/http_response.rb +17 -31
- data/lib/unicorn/http_server.rb +255 -179
- data/lib/unicorn/launcher.rb +1 -1
- data/lib/unicorn/oob_gc.rb +6 -6
- data/lib/unicorn/select_waiter.rb +6 -0
- data/lib/unicorn/socket_helper.rb +58 -78
- data/lib/unicorn/stream_input.rb +8 -7
- data/lib/unicorn/tee_input.rb +8 -10
- data/lib/unicorn/tmpio.rb +8 -7
- data/lib/unicorn/util.rb +5 -4
- data/lib/unicorn/version.rb +1 -1
- data/lib/unicorn/worker.rb +36 -23
- data/lib/unicorn.rb +64 -46
- data/man/man1/unicorn.1 +123 -119
- data/man/man1/unicorn_rails.1 +106 -107
- data/t/GNUmakefile +3 -72
- data/t/README +4 -4
- data/t/t0011-active-unix-socket.sh +1 -1
- data/t/t0012-reload-empty-config.sh +2 -1
- data/t/t0301-no-default-middleware-ignored-in-config.sh +25 -0
- data/t/t0301.ru +13 -0
- data/t/test-lib.sh +4 -3
- data/test/benchmark/README +14 -4
- data/test/benchmark/ddstream.ru +50 -0
- data/test/benchmark/readinput.ru +40 -0
- data/test/benchmark/uconnect.perl +66 -0
- data/test/exec/test_exec.rb +73 -19
- data/test/test_helper.rb +40 -31
- data/test/unit/test_ccc.rb +91 -0
- data/test/unit/test_droplet.rb +1 -1
- data/test/unit/test_http_parser.rb +46 -16
- data/test/unit/test_http_parser_ng.rb +97 -114
- data/test/unit/test_request.rb +10 -10
- data/test/unit/test_response.rb +28 -16
- data/test/unit/test_server.rb +86 -12
- data/test/unit/test_signals.rb +8 -8
- data/test/unit/test_socket_helper.rb +14 -10
- data/test/unit/test_upload.rb +9 -14
- data/test/unit/test_util.rb +31 -5
- data/test/unit/test_waiter.rb +34 -0
- data/unicorn.gemspec +27 -19
- metadata +28 -45
- data/Documentation/GNUmakefile +0 -30
- data/Documentation/unicorn.1.txt +0 -185
- data/Documentation/unicorn_rails.1.txt +0 -175
- data/examples/git.ru +0 -13
- data/lib/unicorn/app/exec_cgi.rb +0 -154
- data/lib/unicorn/app/inetd.rb +0 -109
- data/lib/unicorn/ssl_client.rb +0 -11
- data/lib/unicorn/ssl_configurator.rb +0 -104
- data/lib/unicorn/ssl_server.rb +0 -42
- data/t/hijack.ru +0 -42
- data/t/t0016-trust-x-forwarded-false.sh +0 -30
- data/t/t0017-trust-x-forwarded-true.sh +0 -30
- data/t/t0200-rack-hijack.sh +0 -27
- data/test/unit/test_http_parser_xftrust.rb +0 -38
- data/test/unit/test_sni_hostnames.rb +0 -47
data/FAQ
CHANGED
@@ -1,5 +1,14 @@
|
|
1
1
|
= Frequently Asked Questions about Unicorn
|
2
2
|
|
3
|
+
=== Why is nginx getting ECONNRESET as a reverse proxy?
|
4
|
+
|
5
|
+
Request body data (commonly from POST and PUT requests) may not be
|
6
|
+
drained entirely by the application. This may happen when request
|
7
|
+
bodies are gzipped, as unicorn reads request body data lazily to avoid
|
8
|
+
overhead from bad requests.
|
9
|
+
|
10
|
+
Ref: https://yhbt.net/unicorn-public/FC91211E-FD32-432C-92FC-0318714C2170@zendesk.com/
|
11
|
+
|
3
12
|
=== Why aren't my Rails log files rotated when I use SIGUSR1?
|
4
13
|
|
5
14
|
The Rails autoflush_log option must remain disabled with multiprocess
|
@@ -8,14 +17,6 @@ partially written and lead to corruption in the presence of multiple
|
|
8
17
|
processes. With reasonable amounts of logging, the performance impact
|
9
18
|
of autoflush_log should be negligible on Linux and other modern kernels.
|
10
19
|
|
11
|
-
=== I've installed Rack 1.1.x, why can't Unicorn load Rails (2.3.5)?
|
12
|
-
|
13
|
-
Rails 2.3.5 is not compatible with Rack 1.1.x. Unicorn is compatible
|
14
|
-
with both Rack 1.1.x and Rack 1.0.x, and RubyGems will load the latest
|
15
|
-
version of Rack installed on the system. Uninstalling the Rack 1.1.x
|
16
|
-
gem should solve gem loading issues with Rails 2.3.5. Rails 2.3.6
|
17
|
-
and later correctly support Rack 1.1.x.
|
18
|
-
|
19
20
|
=== Why are my redirects going to "http" URLs when my site uses https?
|
20
21
|
|
21
22
|
If your site is entirely behind https, then Rack applications that use
|
@@ -59,3 +60,11 @@ queue makes failover to a different machine more difficult.
|
|
59
60
|
|
60
61
|
See the TUNING and Unicorn::Configurator documents for more information
|
61
62
|
on :backlog-related topics.
|
63
|
+
|
64
|
+
=== I've installed Rack 1.1.x, why can't Unicorn load Rails (2.3.5)?
|
65
|
+
|
66
|
+
Rails 2.3.5 is not compatible with Rack 1.1.x. Unicorn is compatible
|
67
|
+
with both Rack 1.1.x and Rack 1.0.x, and RubyGems will load the latest
|
68
|
+
version of Rack installed on the system. Uninstalling the Rack 1.1.x
|
69
|
+
gem should solve gem loading issues with Rails 2.3.5. Rails 2.3.6
|
70
|
+
and later correctly support Rack 1.1.x.
|
data/GIT-VERSION-FILE
CHANGED
@@ -1 +1 @@
|
|
1
|
-
GIT_VERSION =
|
1
|
+
GIT_VERSION = 6.1.0
|
data/GIT-VERSION-GEN
CHANGED
data/GNUmakefile
CHANGED
@@ -10,6 +10,7 @@ RAGEL = ragel
|
|
10
10
|
RSYNC = rsync
|
11
11
|
OLDDOC = olddoc
|
12
12
|
RDOC = rdoc
|
13
|
+
INSTALL = install
|
13
14
|
|
14
15
|
GIT-VERSION-FILE: .FORCE-GIT-VERSION-FILE
|
15
16
|
@./GIT-VERSION-GEN
|
@@ -25,7 +26,38 @@ endif
|
|
25
26
|
|
26
27
|
RUBY_ENGINE := $(shell $(RUBY) -e 'puts((RUBY_ENGINE rescue "ruby"))')
|
27
28
|
|
28
|
-
|
29
|
+
# we should never package more than one ext to avoid DSO proliferation:
|
30
|
+
# https://udrepper.livejournal.com/8790.html
|
31
|
+
ext := $(firstword $(wildcard ext/*))
|
32
|
+
|
33
|
+
ragel: $(ext)/unicorn_http.c
|
34
|
+
|
35
|
+
rl_files := $(wildcard $(ext)/*.rl)
|
36
|
+
ragel: $(ext)/unicorn_http.c
|
37
|
+
$(ext)/unicorn_http.c: $(rl_files)
|
38
|
+
cd $(@D) && $(RAGEL) unicorn_http.rl -C $(RLFLAGS) -o $(@F)
|
39
|
+
ext_pfx := test/$(RUBY_ENGINE)-$(RUBY_VERSION)
|
40
|
+
tmp_bin := $(ext_pfx)/bin
|
41
|
+
ext_h := $(wildcard $(ext)/*/*.h $(ext)/*.h)
|
42
|
+
ext_src := $(sort $(wildcard $(ext)/*.c) $(ext_h) $(ext)/unicorn_http.c)
|
43
|
+
ext_pfx_src := $(addprefix $(ext_pfx)/,$(ext_src))
|
44
|
+
ext_dir := $(ext_pfx)/$(ext)
|
45
|
+
$(ext)/extconf.rb:
|
46
|
+
@>>$@
|
47
|
+
$(ext_dir) $(tmp_bin) man/man1 doc/man1 pkg t/trash:
|
48
|
+
@mkdir -p $@
|
49
|
+
$(ext_pfx)/$(ext)/%: $(ext)/% | $(ext_dir)
|
50
|
+
$(INSTALL) -m 644 $< $@
|
51
|
+
$(ext_pfx)/$(ext)/Makefile: $(ext)/extconf.rb | $(ext_dir)
|
52
|
+
$(RM) -f $(@D)/*.o
|
53
|
+
cd $(@D) && $(RUBY) $(CURDIR)/$(ext)/extconf.rb $(EXTCONF_ARGS)
|
54
|
+
ext_sfx := _ext.$(DLEXT)
|
55
|
+
ext_dl := $(ext_pfx)/$(ext)/$(notdir $(ext)_ext.$(DLEXT))
|
56
|
+
$(ext_dl): $(ext_src) $(ext_pfx_src) $(ext_pfx)/$(ext)/Makefile
|
57
|
+
$(MAKE) -C $(@D)
|
58
|
+
lib := $(CURDIR)/lib:$(CURDIR)/$(ext_pfx)/$(ext)
|
59
|
+
http build: $(ext_dl)
|
60
|
+
$(ext_pfx)/$(ext)/unicorn_http.c: ext/unicorn_http/unicorn_http.c
|
29
61
|
|
30
62
|
# dunno how to implement this as concisely in Ruby, and hell, I love awk
|
31
63
|
awk_slow := awk '/def test_/{print FILENAME"--"$$2".n"}' 2>/dev/null
|
@@ -37,44 +69,21 @@ T := $(filter-out $(slow_tests), $(wildcard test/*/test*.rb))
|
|
37
69
|
T_n := $(shell $(awk_slow) $(slow_tests))
|
38
70
|
T_log := $(subst .rb,$(log_suffix),$(T))
|
39
71
|
T_n_log := $(subst .n,$(log_suffix),$(T_n))
|
40
|
-
test_prefix = $(CURDIR)/test/$(RUBY_ENGINE)-$(RUBY_VERSION)
|
41
72
|
|
42
|
-
ext := ext/unicorn_http
|
43
|
-
c_files := $(ext)/unicorn_http.c $(ext)/httpdate.c $(wildcard $(ext)/*.h)
|
44
|
-
rl_files := $(wildcard $(ext)/*.rl)
|
45
73
|
base_bins := unicorn unicorn_rails
|
46
74
|
bins := $(addprefix bin/, $(base_bins))
|
47
75
|
man1_rdoc := $(addsuffix _1, $(base_bins))
|
48
76
|
man1_bins := $(addsuffix .1, $(base_bins))
|
49
77
|
man1_paths := $(addprefix man/man1/, $(man1_bins))
|
50
|
-
|
51
|
-
|
78
|
+
tmp_bins = $(addprefix $(tmp_bin)/, unicorn unicorn_rails)
|
79
|
+
pid := $(shell echo $$PPID)
|
52
80
|
|
53
|
-
|
54
|
-
$(
|
55
|
-
|
56
|
-
|
57
|
-
cd $(@D) && $(RUBY) extconf.rb
|
58
|
-
$(ext)/unicorn_http.$(DLEXT): $(ext)/Makefile
|
59
|
-
$(MAKE) -C $(@D)
|
60
|
-
http: $(ext)/unicorn_http.$(DLEXT)
|
61
|
-
|
62
|
-
# only used for tests
|
63
|
-
http-install: $(ext)/unicorn_http.$(DLEXT)
|
64
|
-
install -m644 $< lib/
|
81
|
+
$(tmp_bin)/%: bin/% | $(tmp_bin)
|
82
|
+
$(INSTALL) -m 755 $< $@.$(pid)
|
83
|
+
$(MRI) -i -p -e '$$_.gsub!(%r{^#!.*$$},"#!$(ruby_bin)")' $@.$(pid)
|
84
|
+
mv $@.$(pid) $@
|
65
85
|
|
66
|
-
|
67
|
-
$(test_prefix)/.stamp: $(inst_deps)
|
68
|
-
mkdir -p $(test_prefix)/.ccache
|
69
|
-
tar cf - $(inst_deps) GIT-VERSION-GEN | \
|
70
|
-
(cd $(test_prefix) && tar xf -)
|
71
|
-
$(MAKE) -C $(test_prefix) clean
|
72
|
-
$(MAKE) -C $(test_prefix) http-install shebang RUBY="$(RUBY)"
|
73
|
-
> $@
|
74
|
-
|
75
|
-
# this is only intended to be run within $(test_prefix)
|
76
|
-
shebang: $(bins)
|
77
|
-
$(MRI) -i -p -e '$$_.gsub!(%r{^#!.*$$},"#!$(ruby_bin)")' $^
|
86
|
+
bins: $(tmp_bins)
|
78
87
|
|
79
88
|
t_log := $(T_log) $(T_n_log)
|
80
89
|
test: $(T) $(T_n)
|
@@ -83,13 +92,56 @@ test: $(T) $(T_n)
|
|
83
92
|
|
84
93
|
test-exec: $(wildcard test/exec/test_*.rb)
|
85
94
|
test-unit: $(wildcard test/unit/test_*.rb)
|
86
|
-
$(slow_tests): $(
|
95
|
+
$(slow_tests): $(ext_dl)
|
87
96
|
@$(MAKE) $(shell $(awk_slow) $@)
|
88
97
|
|
89
|
-
|
90
|
-
|
98
|
+
# ensure we can require just the HTTP parser without the rest of unicorn
|
99
|
+
test-require: $(ext_dl)
|
100
|
+
$(RUBY) --disable-gems -I$(ext_pfx)/$(ext) -runicorn_http -e Unicorn
|
101
|
+
|
102
|
+
test_prereq := $(tmp_bins) $(ext_dl)
|
91
103
|
|
92
|
-
|
104
|
+
SH_TEST_OPTS =
|
105
|
+
ifdef V
|
106
|
+
ifeq ($(V),2)
|
107
|
+
SH_TEST_OPTS += --trace
|
108
|
+
else
|
109
|
+
SH_TEST_OPTS += --verbose
|
110
|
+
endif
|
111
|
+
endif
|
112
|
+
|
113
|
+
# do we trust Ruby behavior to be stable? some tests are
|
114
|
+
# (mostly) POSIX sh (not bash or ksh93, so no "set -o pipefail"
|
115
|
+
# TRACER = strace -f -o $(t_pfx).strace -s 100000
|
116
|
+
# TRACER = /usr/bin/time -o $(t_pfx).time
|
117
|
+
t_pfx = trash/$@-$(RUBY_ENGINE)-$(RUBY_VERSION)
|
118
|
+
T_sh = $(wildcard t/t[0-9][0-9][0-9][0-9]-*.sh)
|
119
|
+
$(T_sh): export RUBY := $(RUBY)
|
120
|
+
$(T_sh): export PATH := $(CURDIR)/$(tmp_bin):$(PATH)
|
121
|
+
$(T_sh): export RUBYLIB := $(lib):$(RUBYLIB)
|
122
|
+
$(T_sh): dep $(test_prereq) t/random_blob t/trash/.gitignore
|
123
|
+
cd t && $(TRACER) $(SHELL) $(SH_TEST_OPTS) $(@F) $(TEST_OPTS)
|
124
|
+
|
125
|
+
t/trash/.gitignore : | t/trash
|
126
|
+
echo '*' >$@
|
127
|
+
|
128
|
+
dependencies := socat curl
|
129
|
+
deps := $(addprefix t/.dep+,$(dependencies))
|
130
|
+
$(deps): dep_bin = $(lastword $(subst +, ,$@))
|
131
|
+
$(deps):
|
132
|
+
@which $(dep_bin) > $@.$(pid) 2>/dev/null || :
|
133
|
+
@test -s $@.$(pid) || \
|
134
|
+
{ echo >&2 "E '$(dep_bin)' not found in PATH=$(PATH)"; exit 1; }
|
135
|
+
@mv $@.$(pid) $@
|
136
|
+
dep: $(deps)
|
137
|
+
|
138
|
+
t/random_blob:
|
139
|
+
dd if=/dev/urandom bs=1M count=30 of=$@.$(pid)
|
140
|
+
mv $@.$(pid) $@
|
141
|
+
|
142
|
+
test-integration: $(T_sh)
|
143
|
+
|
144
|
+
check: test-require test test-integration
|
93
145
|
test-all: check
|
94
146
|
|
95
147
|
TEST_OPTS = -v
|
@@ -118,16 +170,16 @@ run_test = $(quiet_pre) \
|
|
118
170
|
|
119
171
|
%.n: arg = $(subst .n,,$(subst --, -n ,$@))
|
120
172
|
%.n: t = $(subst .n,$(log_suffix),$@)
|
121
|
-
%.n: export PATH := $(
|
122
|
-
%.n: export RUBYLIB := $(
|
123
|
-
%.n: $(
|
173
|
+
%.n: export PATH := $(CURDIR)/$(tmp_bin):$(PATH)
|
174
|
+
%.n: export RUBYLIB := $(lib):$(RUBYLIB)
|
175
|
+
%.n: $(test_prereq)
|
124
176
|
$(run_test)
|
125
177
|
|
126
178
|
$(T): arg = $@
|
127
179
|
$(T): t = $(subst .rb,$(log_suffix),$@)
|
128
|
-
$(T): export PATH := $(
|
129
|
-
$(T): export RUBYLIB := $(
|
130
|
-
$(T): $(
|
180
|
+
$(T): export PATH := $(CURDIR)/$(tmp_bin):$(PATH)
|
181
|
+
$(T): export RUBYLIB := $(lib):$(RUBYLIB)
|
182
|
+
$(T): $(test_prereq)
|
131
183
|
$(run_test)
|
132
184
|
|
133
185
|
install: $(bins) $(ext)/unicorn_http.c
|
@@ -146,13 +198,21 @@ prep_setup_rb := @-$(RM) $(setup_rb_files);$(MAKE) -C $(ext) clean
|
|
146
198
|
|
147
199
|
clean:
|
148
200
|
-$(MAKE) -C $(ext) clean
|
149
|
-
-$(MAKE) -C Documentation clean
|
150
201
|
$(RM) $(ext)/Makefile
|
151
202
|
$(RM) $(setup_rb_files) $(t_log)
|
152
|
-
$(RM) -r $(
|
203
|
+
$(RM) -r $(ext_pfx) man t/trash
|
204
|
+
$(RM) $(html1)
|
205
|
+
|
206
|
+
man1 := $(addprefix Documentation/, unicorn.1 unicorn_rails.1)
|
207
|
+
html1 := $(addsuffix .html, $(man1))
|
208
|
+
man : $(man1) | man/man1
|
209
|
+
$(INSTALL) -m 644 $(man1) man/man1
|
153
210
|
|
154
|
-
|
155
|
-
$(
|
211
|
+
html : $(html1) | doc/man1
|
212
|
+
$(INSTALL) -m 644 $(html1) doc/man1
|
213
|
+
|
214
|
+
%.1.html: %.1
|
215
|
+
$(OLDDOC) man2html -o $@ ./$<
|
156
216
|
|
157
217
|
pkg_extra := GIT-VERSION-FILE lib/unicorn/version.rb LATEST NEWS \
|
158
218
|
$(ext)/unicorn_http.c $(man1_paths)
|
@@ -171,20 +231,22 @@ doc: .document $(ext)/unicorn_http.c man html .olddoc.yml $(PLACEHOLDERS)
|
|
171
231
|
find bin lib -type f -name '*.rbc' -exec rm -f '{}' ';'
|
172
232
|
$(RM) -r doc
|
173
233
|
$(OLDDOC) prepare
|
174
|
-
$(RDOC) -f
|
234
|
+
$(RDOC) -f dark216
|
175
235
|
$(OLDDOC) merge
|
176
|
-
|
177
|
-
|
178
|
-
|
236
|
+
$(INSTALL) -m 644 COPYING doc/COPYING
|
237
|
+
$(INSTALL) -m 644 NEWS.atom.xml doc/NEWS.atom.xml
|
238
|
+
$(INSTALL) -m 644 $(shell LC_ALL=C grep '^[A-Z]' .document) doc/
|
239
|
+
$(INSTALL) -m 644 $(man1_paths) doc/
|
179
240
|
tar cf - $$(git ls-files examples/) | (cd doc && tar xf -)
|
180
241
|
|
181
|
-
# publishes docs to
|
242
|
+
# publishes docs to https://yhbt.net/unicorn/
|
182
243
|
publish_doc:
|
183
244
|
-git set-file-times
|
184
245
|
$(MAKE) doc
|
185
246
|
$(MAKE) doc_gz
|
186
247
|
chmod 644 $$(find doc -type f)
|
187
|
-
$(RSYNC) -av doc/
|
248
|
+
$(RSYNC) -av doc/ yhbt.net:/srv/yhbt/unicorn/ \
|
249
|
+
--exclude index.html* --exclude created.rid*
|
188
250
|
git ls-files | xargs touch
|
189
251
|
|
190
252
|
# Create gzip variants of the same timestamp as the original so nginx
|
@@ -214,11 +276,10 @@ fix-perms:
|
|
214
276
|
gem: $(pkggem)
|
215
277
|
|
216
278
|
install-gem: $(pkggem)
|
217
|
-
gem install $(CURDIR)/$<
|
279
|
+
gem install --local $(CURDIR)/$<
|
218
280
|
|
219
|
-
$(pkggem): .manifest fix-perms
|
281
|
+
$(pkggem): .manifest fix-perms | pkg
|
220
282
|
gem build $(rfpackage).gemspec
|
221
|
-
mkdir -p pkg
|
222
283
|
mv $(@F) $@
|
223
284
|
|
224
285
|
$(pkgtgz): distdir = $(basename $@)
|
@@ -244,5 +305,9 @@ endif
|
|
244
305
|
$(PLACEHOLDERS):
|
245
306
|
echo olddoc_placeholder > $@
|
246
307
|
|
247
|
-
|
248
|
-
|
308
|
+
check-warnings:
|
309
|
+
@(for i in $$(git ls-files '*.rb' bin | grep -v '^setup\.rb$$'); \
|
310
|
+
do $(RUBY) --disable-gems -d -W2 -c \
|
311
|
+
$$i; done) | grep -v '^Syntax OK$$' || :
|
312
|
+
|
313
|
+
.PHONY: .FORCE-GIT-VERSION-FILE doc $(T) $(slow_tests) man $(T_sh) clean
|
data/HACKING
CHANGED
@@ -50,20 +50,17 @@ programming experience will come in handy (or be learned) here.
|
|
50
50
|
|
51
51
|
=== Documentation
|
52
52
|
|
53
|
-
Due to the lack of RDoc-to-manpage converters we know about, we're
|
54
|
-
writing manpages in Markdown and converting to troff/HTML with Pandoc.
|
55
|
-
|
56
53
|
Please wrap documentation at 72 characters-per-line or less (long URLs
|
57
54
|
are exempt) so it is comfortably readable from terminals.
|
58
55
|
|
59
56
|
When referencing mailing list posts, use
|
60
|
-
|
57
|
+
<tt>https://yhbt.net/unicorn-public/$MESSAGE_ID/</tt> if possible
|
61
58
|
since the Message-ID remains searchable even if a particular site
|
62
59
|
becomes unavailable.
|
63
60
|
|
64
61
|
=== Ruby/C Compatibility
|
65
62
|
|
66
|
-
We target
|
63
|
+
We target C Ruby 2.0 and later. We need the Ruby
|
67
64
|
implementation to support fork, exec, pipe, UNIX signals, access to
|
68
65
|
integer file descriptors and ability to use unlinked files.
|
69
66
|
|
@@ -102,11 +99,6 @@ don't email the git mailing list or maintainer with Unicorn patches :)
|
|
102
99
|
|
103
100
|
== Building a Gem
|
104
101
|
|
105
|
-
In order to build the gem, you must install the following components:
|
106
|
-
|
107
|
-
* olddoc (RubyGem)
|
108
|
-
* pandoc
|
109
|
-
|
110
102
|
You can build the Unicorn gem with the following command:
|
111
103
|
|
112
104
|
gmake gem
|
data/ISSUES
CHANGED
@@ -1,19 +1,33 @@
|
|
1
1
|
= Issues
|
2
2
|
|
3
|
-
mailto:unicorn-public@
|
3
|
+
mailto:unicorn-public@yhbt.net is the best place to report bugs,
|
4
4
|
submit patches and/or obtain support after you have searched the
|
5
|
-
{email archives}[
|
6
|
-
{documentation}[
|
5
|
+
{email archives}[https://yhbt.net/unicorn-public/] and
|
6
|
+
{documentation}[https://yhbt.net/unicorn/].
|
7
7
|
|
8
|
-
* No subscription will ever be required to email
|
8
|
+
* No subscription will ever be required to email us
|
9
9
|
* Cc: all participants in a thread or commit, as subscription is optional
|
10
10
|
* Do not {top post}[http://catb.org/jargon/html/T/top-post.html] in replies
|
11
11
|
* Quote as little as possible of the message you're replying to
|
12
|
-
* Do not send HTML mail
|
12
|
+
* Do not send HTML mail or images,
|
13
|
+
they hurt reader privacy and will be flagged as spam
|
14
|
+
* Anonymous and pseudonymous messages will ALWAYS be welcome
|
15
|
+
* The email submission port (587) is enabled on the yhbt.net MX:
|
16
|
+
https://yhbt.net/unicorn-public/20141004232241.GA23908@dcvr.yhbt.net/t/
|
17
|
+
|
18
|
+
We will never have a centralized or formal bug tracker. Instead we
|
19
|
+
can interoperate with any bug tracker which can Cc: us plain-text to
|
20
|
+
mailto:unicorn-public@yhbt.net This includes the Debian BTS
|
21
|
+
at https://bugs.debian.org/unicorn and possibly others.
|
22
|
+
|
23
|
+
unicorn is a server; it does not depend on graphics/audio. Nobody
|
24
|
+
communicating with us will ever be expected to go through the trouble
|
25
|
+
of setting up graphics nor audio support.
|
13
26
|
|
14
27
|
If your issue is of a sensitive nature or you're just shy in public,
|
15
|
-
|
16
|
-
|
28
|
+
use anonymity tools such as Tor or Mixmaster; and rely on the public
|
29
|
+
mail archives for responses. Be sure to scrub sensitive log messages
|
30
|
+
and such.
|
17
31
|
|
18
32
|
If you don't get a response within a few days, we may have forgotten
|
19
33
|
about it so feel free to ask again.
|
@@ -29,6 +43,7 @@ https://bugs.ruby-lang.org/ and discuss+fix them on the ruby-core
|
|
29
43
|
list at mailto:ruby-core@ruby-lang.org
|
30
44
|
Subscription to post is required to ruby-core, unfortunately:
|
31
45
|
mailto:ruby-core-request@ruby-lang.org?subject=subscribe
|
46
|
+
Unofficial archives are available at: https://public-inbox.org/ruby-core/
|
32
47
|
|
33
48
|
For uncommon bugs in Rack, we may forward bugs to
|
34
49
|
mailto:rack-devel@googlegroups.com and discuss there.
|
@@ -36,6 +51,7 @@ Subscription (without any web UI or Google account) is possible via:
|
|
36
51
|
mailto:rack-devel+subscribe@googlegroups.com
|
37
52
|
Note: not everyone can use the proprietary bug tracker used by Rack,
|
38
53
|
but their mailing list remains operational.
|
54
|
+
Unofficial archives are available at: https://public-inbox.org/rack-devel/
|
39
55
|
|
40
56
|
Uncommon bugs we encounter in the Linux kernel should be Cc:-ed to the
|
41
57
|
Linux kernel mailing list (LKML) at mailto:linux-kernel@vger.kernel.org
|
@@ -44,11 +60,12 @@ and subsystem maintainers such as mailto:netdev@vger.kernel.org
|
|
44
60
|
involved with any problematic commits (including those in the
|
45
61
|
Signed-off-by: and other trailer lines). No subscription is necessary,
|
46
62
|
and the our mailing list follows the same conventions as LKML for
|
47
|
-
interopability.
|
48
|
-
ignored by most
|
63
|
+
interopability. Archives are available at https://lore.kernel.org/lkml/
|
64
|
+
There is a kernel.org Bugzilla instance, but it is ignored by most.
|
49
65
|
|
50
66
|
Likewise for any rare glibc bugs we might encounter, we should Cc:
|
51
67
|
mailto:libc-alpha@sourceware.org
|
68
|
+
Unofficial archives are available at: https://public-inbox.org/libc-alpha/
|
52
69
|
Keep in mind glibc upstream does use Bugzilla for tracking bugs:
|
53
70
|
https://sourceware.org/bugzilla/
|
54
71
|
|
@@ -60,41 +77,21 @@ document distributed with git) on guidelines for patch submission.
|
|
60
77
|
|
61
78
|
== Contact Info
|
62
79
|
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
We operate a {public-inbox}[http://public-inbox.org/] which
|
67
|
-
feeds the mailing list. You may subscribe either using
|
68
|
-
{ssoma}[http://ssoma.public-inbox.org/] or by sending a mail
|
69
|
-
to mailto:unicorn-public+subscribe@bogomips.org
|
70
|
-
|
71
|
-
ssoma is a mail archiver/fetcher using git. It operates in a similar
|
72
|
-
fashion to tools such as slrnpull, fetchmail, or getmail. ssoma
|
73
|
-
subscription instructions:
|
74
|
-
|
75
|
-
URL=git://bogomips.org/unicorn-public
|
76
|
-
LISTNAME=unicorn
|
77
|
-
|
78
|
-
# to initialize a maildir (this may be a new or existing maildir,
|
79
|
-
# ssoma will not touch existing messages)
|
80
|
-
# If you prefer mbox, use mbox:/path/to/mbox as the last argument
|
81
|
-
# You may also use imap://$MAILSERVER/INBOX for an IMAP account
|
82
|
-
# or imaps:// for an IMAPS account, as well.
|
83
|
-
ssoma add $LISTNAME $URL maildir:/path/to/maildir
|
84
|
-
|
85
|
-
# read with your favorite MUA (only using mutt as an example)
|
86
|
-
mutt -f /path/to/maildir # (or /path/to/mbox)
|
87
|
-
|
88
|
-
# to keep your mbox or maildir up-to-date, periodically run the following:
|
89
|
-
ssoma sync $LISTNAME
|
80
|
+
Mail is publicly-archived, SMTP subscription is discouraged to avoid
|
81
|
+
servers being a single-point-of-failure, so Cc: all participants.
|
90
82
|
|
91
|
-
|
92
|
-
|
83
|
+
The HTTP(S) archives have links to per-thread Atom feeds and downloadable
|
84
|
+
mboxes. Read-only IMAP(S) folders and NNTP(S) newsgroups are also available.
|
93
85
|
|
94
|
-
|
95
|
-
|
86
|
+
* https://yhbt.net/unicorn-public/
|
87
|
+
* http://7fh6tueqddpjyxjmgtdiueylzoqt6pt7hec3pukyptlmohoowvhde4yd.onion/unicorn-public/
|
88
|
+
* imaps://yhbt.net/inbox.comp.lang.ruby.unicorn.0
|
89
|
+
* imap://7fh6tueqddpjyxjmgtdiueylzoqt6pt7hec3pukyptlmohoowvhde4yd.onion/inbox.comp.lang.ruby.unicorn.0
|
90
|
+
* nntps://news.public-inbox.org/inbox.comp.lang.ruby.unicorn
|
91
|
+
* nntp://news.gmane.io/gmane.comp.lang.ruby.unicorn.general
|
96
92
|
|
97
|
-
|
98
|
-
|
93
|
+
Full Atom feeds:
|
94
|
+
* https://yhbt.net/unicorn-public/new.atom
|
95
|
+
* http://7fh6tueqddpjyxjmgtdiueylzoqt6pt7hec3pukyptlmohoowvhde4yd.onion/unicorn-public/new.atom
|
99
96
|
|
100
|
-
|
97
|
+
We only accept plain-text mail: mailto:unicorn-public@yhbt.net
|
data/KNOWN_ISSUES
CHANGED
@@ -9,11 +9,11 @@ acceptable solution. Those issues are documented here.
|
|
9
9
|
handlers.
|
10
10
|
|
11
11
|
* Issues with FreeBSD jails can be worked around as documented by Tatsuya Ono:
|
12
|
-
|
12
|
+
https://yhbt.net/unicorn-public/CAHBuKRj09FdxAgzsefJWotexw-7JYZGJMtgUp_dhjPz9VbKD6Q@mail.gmail.com/
|
13
13
|
|
14
14
|
* PRNGs (pseudo-random number generators) loaded before forking
|
15
15
|
(e.g. "preload_app true") may need to have their internal state
|
16
|
-
reset in the after_fork hook. Starting with
|
16
|
+
reset in the after_fork hook. Starting with unicorn 3.6.1, we
|
17
17
|
have builtin workarounds for Kernel#rand and OpenSSL::Random users,
|
18
18
|
but applications may use other PRNGs.
|
19
19
|
|
@@ -36,31 +36,31 @@ acceptable solution. Those issues are documented here.
|
|
36
36
|
|
37
37
|
* Under some versions of Ruby 1.8, it is necessary to call +srand+ in an
|
38
38
|
after_fork hook to get correct random number generation. We have a builtin
|
39
|
-
workaround for this starting with
|
39
|
+
workaround for this starting with unicorn 3.6.1
|
40
40
|
|
41
|
-
See http://
|
41
|
+
See http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/36450
|
42
42
|
|
43
43
|
* On Ruby 1.8 prior to Ruby 1.8.7-p248, *BSD platforms have a broken
|
44
44
|
stdio that causes failure for file uploads larger than 112K. Upgrade
|
45
|
-
your version of Ruby or continue using
|
45
|
+
your version of Ruby or continue using unicorn 1.x/3.4.x.
|
46
46
|
|
47
47
|
* Under Ruby 1.9.1, methods like Array#shuffle and Array#sample will
|
48
48
|
segfault if called after forking. Upgrade to Ruby 1.9.2 or call
|
49
49
|
"Kernel.rand" in your after_fork hook to reinitialize the random
|
50
50
|
number generator.
|
51
51
|
|
52
|
-
See http://
|
52
|
+
See http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/28655
|
53
53
|
|
54
54
|
* Rails 2.3.2 bundles its own version of Rack. This may cause subtle
|
55
55
|
bugs when simultaneously loaded with the system-wide Rack Rubygem
|
56
|
-
which
|
56
|
+
which unicorn depends on. Upgrading to Rails 2.3.4 (or later) is
|
57
57
|
strongly recommended for all Rails 2.3.x users for this (and security
|
58
58
|
reasons). Rails 2.2.x series (or before) did not bundle Rack and are
|
59
59
|
should be unnaffected. If there is any reason which forces your
|
60
60
|
application to use Rails 2.3.2 and you have no other choice, then
|
61
|
-
you may edit your
|
61
|
+
you may edit your unicorn gemspec and remove the Rack dependency.
|
62
62
|
|
63
|
-
ref:
|
63
|
+
ref: https://yhbt.net/unicorn-public/20091014221552.GA30624@dcvr.yhbt.net/
|
64
64
|
Note: the workaround described in the article above only made
|
65
65
|
the issue more subtle and we didn't notice them immediately.
|
66
66
|
|
@@ -71,9 +71,9 @@ acceptable solution. Those issues are documented here.
|
|
71
71
|
set :env, :production
|
72
72
|
set :run, false
|
73
73
|
Since this is no longer an issue with Sinatra 0.9.x apps, this will not be
|
74
|
-
fixed on our end. Since
|
74
|
+
fixed on our end. Since unicorn is itself the application launcher, the
|
75
75
|
at_exit handler used in old Sinatra always caused Mongrel to be launched
|
76
|
-
whenever a
|
76
|
+
whenever a unicorn worker was about to exit.
|
77
77
|
|
78
78
|
Also remember we're capable of replacing the running binary without dropping
|
79
79
|
any connections regardless of framework :)
|
data/LATEST
CHANGED
@@ -1,30 +1,24 @@
|
|
1
|
-
=== unicorn
|
1
|
+
=== unicorn 6.0.0 - no more recycling Rack env / 2021-03-17 06:38 UTC
|
2
2
|
|
3
|
-
This release
|
4
|
-
|
5
|
-
|
3
|
+
This release allocates a new Rack `env' hash for every request.
|
4
|
+
This is done for safety with internally-(thread|event)-using Rack
|
5
|
+
apps which expect to use `env' after the normal Rack response is
|
6
|
+
complete, but without relying on rack.hijack[1]. Thanks to
|
7
|
+
Dirkjan Bussink <d.bussink@gmail.com> for the patch:
|
6
8
|
|
7
|
-
|
8
|
-
(no subscription required, plain text only)
|
9
|
-
ssoma[2] git archives: git://bogomips.org/unicorn-public
|
10
|
-
browser-friendly archives: http://bogomips.org/unicorn-public/
|
9
|
+
https://yhbt.net/unicorn-public/66A68DD8-83EF-4C7A-80E8-3F1F7AB31670@github.com/
|
11
10
|
|
12
|
-
|
13
|
-
require any of the following:
|
11
|
+
The major version is bumped since:
|
14
12
|
|
15
|
-
1)
|
16
|
-
2) registration or sign-in of any kind
|
17
|
-
3) a real identity (we accept mail from Mixmaster)
|
18
|
-
4) a graphical user interface
|
13
|
+
1) there are performance regressions for some simple Rack apps
|
19
14
|
|
20
|
-
|
21
|
-
|
15
|
+
2) unsupported 3rd-party monkey patches which previously
|
16
|
+
relied on this behavior may be broken (our version of
|
17
|
+
OobGC was).
|
22
18
|
|
23
|
-
|
24
|
-
|
19
|
+
The test suite is also more reliable on multi-core systems
|
20
|
+
and Ruby 3.x.
|
25
21
|
|
26
|
-
[1]
|
27
|
-
|
28
|
-
[2] mechanism: http://ssoma.public-inbox.org/ - git://80x24.org/ssoma
|
29
|
-
some sort of mail archiver (using git)
|
22
|
+
[1] thread from 2017 around rack.hijack safety:
|
23
|
+
https://yhbt.net/unicorn-public/CAAtdryPG3nLuyo0jxfYW1YHu1Q+ZpkLkd4KdWC8vA46B5haZxw@mail.gmail.com/
|
30
24
|
|
data/LICENSE
CHANGED
@@ -8,8 +8,8 @@ any later version. We currently prefer the GPLv3 or later for
|
|
8
8
|
derivative works, but the GPLv2 is fine.
|
9
9
|
|
10
10
|
The complete texts of the GPLv2 and GPLv3 are below:
|
11
|
-
GPLv2 -
|
12
|
-
GPLv3 -
|
11
|
+
GPLv2 - https://www.gnu.org/licenses/gpl-2.0.txt
|
12
|
+
GPLv3 - https://www.gnu.org/licenses/gpl-3.0.txt
|
13
13
|
|
14
14
|
You may (against our _preference_) also use the Ruby 1.8 license terms
|
15
15
|
which we inherited from the original Mongrel project when we forked it:
|