unicorn 5.4.0 → 5.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/GIT-VERSION-GEN +1 -1
- data/lib/unicorn/http_server.rb +12 -12
- data/lib/unicorn/socket_helper.rb +2 -2
- data/lib/unicorn/util.rb +2 -2
- data/test/exec/test_exec.rb +6 -7
- data/test/unit/test_ccc.rb +1 -1
- data/test/unit/test_server.rb +5 -5
- data/test/unit/test_signals.rb +2 -2
- data/test/unit/test_socket_helper.rb +4 -4
- data/unicorn.gemspec +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5e12c8bfe14a84877de48727dd053f35d815c68e35e62aa9db57fb1bdc520d22
|
4
|
+
data.tar.gz: 9e74449cbf6adf07b27f6745829e794a11c29537917c6a8e7cd31fd59669625f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 643c4edec67b12b5fd6d0708e26b169e68ead4332d862b84aa3fc0319fec2f2e3d6a1822ee8b74d7570b5ce42cda9705aba5ac18a1ab1987a018f270d86b8994
|
7
|
+
data.tar.gz: bbc7ab165c6d9a4a8bd2e23a3740029c8653d09a0573bec41d4cfbdcbfcfce27de88859d608c06e0aabb76ffcb015924b54b276b731875554f593a399810bd58
|
data/GIT-VERSION-GEN
CHANGED
data/lib/unicorn/http_server.rb
CHANGED
@@ -553,9 +553,9 @@ def spawn_missing_workers
|
|
553
553
|
@workers[pid] = worker
|
554
554
|
worker.atfork_parent
|
555
555
|
end
|
556
|
-
|
557
|
-
|
558
|
-
|
556
|
+
rescue => e
|
557
|
+
@logger.error(e) rescue nil
|
558
|
+
exit!
|
559
559
|
end
|
560
560
|
|
561
561
|
def maintain_worker_count
|
@@ -586,7 +586,7 @@ def handle_error(client, e)
|
|
586
586
|
client.kgio_trywrite(err_response(code, @request.response_start_sent))
|
587
587
|
end
|
588
588
|
client.close
|
589
|
-
|
589
|
+
rescue
|
590
590
|
end
|
591
591
|
|
592
592
|
def e100_response_write(client, env)
|
@@ -669,9 +669,9 @@ def reopen_worker_logs(worker_nr)
|
|
669
669
|
logger.info "worker=#{worker_nr} reopening logs..."
|
670
670
|
Unicorn::Util.reopen_logs
|
671
671
|
logger.info "worker=#{worker_nr} done reopening logs"
|
672
|
-
|
673
|
-
|
674
|
-
|
672
|
+
rescue => e
|
673
|
+
logger.error(e) rescue nil
|
674
|
+
exit!(77) # EX_NOPERM in sysexits.h
|
675
675
|
end
|
676
676
|
|
677
677
|
# runs inside each forked worker, this sits around and waits
|
@@ -757,11 +757,11 @@ def valid_pid?(path)
|
|
757
757
|
wpid <= 0 and return
|
758
758
|
Process.kill(0, wpid)
|
759
759
|
wpid
|
760
|
-
|
761
|
-
|
762
|
-
|
763
|
-
|
764
|
-
|
760
|
+
rescue Errno::EPERM
|
761
|
+
logger.info "pid=#{path} possibly stale, got EPERM signalling PID:#{wpid}"
|
762
|
+
nil
|
763
|
+
rescue Errno::ESRCH, Errno::ENOENT
|
764
|
+
# don't unlink stale pid files, racy without non-portable locking...
|
765
765
|
end
|
766
766
|
|
767
767
|
def load_config!
|
@@ -100,8 +100,8 @@ def set_server_sockopt(sock, opt)
|
|
100
100
|
log_buffer_sizes(sock, " after: ")
|
101
101
|
end
|
102
102
|
sock.listen(opt[:backlog])
|
103
|
-
|
104
|
-
|
103
|
+
rescue => e
|
104
|
+
Unicorn.log_error(logger, "#{sock_name(sock)} #{opt.inspect}", e)
|
105
105
|
end
|
106
106
|
|
107
107
|
def log_buffer_sizes(sock, pfx = '')
|
data/lib/unicorn/util.rb
CHANGED
data/test/exec/test_exec.rb
CHANGED
@@ -193,8 +193,8 @@ def test_working_directory_rel_path_config_file
|
|
193
193
|
assert_equal other.path, results.first
|
194
194
|
|
195
195
|
Process.kill(:QUIT, pid)
|
196
|
-
|
197
|
-
|
196
|
+
ensure
|
197
|
+
FileUtils.rmtree(other.path)
|
198
198
|
end
|
199
199
|
|
200
200
|
def test_working_directory
|
@@ -229,8 +229,8 @@ def test_working_directory
|
|
229
229
|
assert_equal other.path, results.first
|
230
230
|
|
231
231
|
Process.kill(:QUIT, pid)
|
232
|
-
|
233
|
-
|
232
|
+
ensure
|
233
|
+
FileUtils.rmtree(other.path)
|
234
234
|
end
|
235
235
|
|
236
236
|
def test_working_directory_controls_relative_paths
|
@@ -271,11 +271,10 @@ def test_working_directory_controls_relative_paths
|
|
271
271
|
wait_master_ready("#{other.path}/stderr_log_here")
|
272
272
|
|
273
273
|
Process.kill(:QUIT, pid)
|
274
|
-
|
275
|
-
|
274
|
+
ensure
|
275
|
+
FileUtils.rmtree(other.path)
|
276
276
|
end
|
277
277
|
|
278
|
-
|
279
278
|
def test_exit_signals
|
280
279
|
%w(INT TERM QUIT).each do |sig|
|
281
280
|
File.open("config.ru", "wb") { |fp| fp.syswrite(HI) }
|
data/test/unit/test_ccc.rb
CHANGED
@@ -44,7 +44,7 @@ def test_ccc_tcpi
|
|
44
44
|
# make sure the server is running, at least
|
45
45
|
client = TCPSocket.new(host, port)
|
46
46
|
client.write("GET / HTTP/1.1\r\nHost: example.com\r\n\r\n")
|
47
|
-
assert client.
|
47
|
+
assert client.wait(10), 'never got response from server'
|
48
48
|
res = client.read
|
49
49
|
assert_match %r{\AHTTP/1\.1 200}, res, 'got part of first response'
|
50
50
|
assert_match %r{\r\n\r\n\z}, res, 'got end of response, server is ready'
|
data/test/unit/test_server.rb
CHANGED
@@ -17,9 +17,9 @@ def call(env)
|
|
17
17
|
while env['rack.input'].read(4096)
|
18
18
|
end
|
19
19
|
[200, { 'Content-Type' => 'text/plain' }, ['hello!\n']]
|
20
|
-
|
21
|
-
|
22
|
-
|
20
|
+
rescue Unicorn::ClientShutdown, Unicorn::HttpParserError => e
|
21
|
+
$stderr.syswrite("#{e.class}: #{e.message} #{e.backtrace.empty?}\n")
|
22
|
+
raise e
|
23
23
|
end
|
24
24
|
end
|
25
25
|
|
@@ -80,8 +80,8 @@ def test_preload_app_config
|
|
80
80
|
loader_pid = tmp.sysread(4096).to_i
|
81
81
|
assert_equal $$, loader_pid
|
82
82
|
assert worker_pid != loader_pid
|
83
|
-
|
84
|
-
|
83
|
+
ensure
|
84
|
+
tmp.close!
|
85
85
|
end
|
86
86
|
|
87
87
|
def test_broken_app
|
data/test/unit/test_signals.rb
CHANGED
@@ -114,8 +114,8 @@ def test_timeout_slow_response
|
|
114
114
|
assert_nil buf
|
115
115
|
assert diff > 1.0, "diff was #{diff.inspect}"
|
116
116
|
assert diff < 60.0
|
117
|
-
|
118
|
-
|
117
|
+
ensure
|
118
|
+
Process.kill(:TERM, pid) rescue nil
|
119
119
|
end
|
120
120
|
|
121
121
|
def test_response_write
|
@@ -57,8 +57,8 @@ def test_bind_listen_unix
|
|
57
57
|
assert File.readable?(@unix_listener_path), "not readable"
|
58
58
|
assert File.writable?(@unix_listener_path), "not writable"
|
59
59
|
assert_equal 0777, File.umask
|
60
|
-
|
61
|
-
|
60
|
+
ensure
|
61
|
+
File.umask(old_umask)
|
62
62
|
end
|
63
63
|
|
64
64
|
def test_bind_listen_unix_umask
|
@@ -71,8 +71,8 @@ def test_bind_listen_unix_umask
|
|
71
71
|
assert_equal @unix_listener_path, sock_name(@unix_listener)
|
72
72
|
assert_equal 0140700, File.stat(@unix_listener_path).mode
|
73
73
|
assert_equal 0777, File.umask
|
74
|
-
|
75
|
-
|
74
|
+
ensure
|
75
|
+
File.umask(old_umask)
|
76
76
|
end
|
77
77
|
|
78
78
|
def test_bind_listen_unix_idempotent
|
data/unicorn.gemspec
CHANGED
@@ -11,7 +11,7 @@
|
|
11
11
|
|
12
12
|
Gem::Specification.new do |s|
|
13
13
|
s.name = %q{unicorn}
|
14
|
-
s.version = (ENV['VERSION'] || '5.4.
|
14
|
+
s.version = (ENV['VERSION'] || '5.4.1').dup
|
15
15
|
s.authors = ['unicorn hackers']
|
16
16
|
s.summary = 'Rack HTTP server for fast clients and Unix'
|
17
17
|
s.description = File.read('README').split("\n\n")[1]
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: unicorn
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.4.
|
4
|
+
version: 5.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- unicorn hackers
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-07-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack
|
@@ -288,7 +288,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
288
288
|
version: '0'
|
289
289
|
requirements: []
|
290
290
|
rubyforge_project:
|
291
|
-
rubygems_version: 2.7.
|
291
|
+
rubygems_version: 2.7.7
|
292
292
|
signing_key:
|
293
293
|
specification_version: 4
|
294
294
|
summary: Rack HTTP server for fast clients and Unix
|