codeclimate 0.35.1 → 0.35.2
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.
- checksums.yaml +4 -4
- data/lib/cc/analyzer/container.rb +14 -5
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d89520fad83fbb50d3b157b90ab06e0570e33efe
|
4
|
+
data.tar.gz: c940f78b63be95cb4b83809324c5598673fe4359
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b8b0eab306b1f7a8cbc8070a59347b8275973a4fd9ab21352dd6e9cad99489f87503d4e6d1310a11f92c81bfd824ad16de4b2b4dd18728de4b66850a09be1319
|
7
|
+
data.tar.gz: d706dc63889d0c8538f9efeb453cca2bba267b3542e8ff61f0aa60902c9377caf7b408c95159d4574a0d838ffc531db94585e12ca9b5e29949a3d5afe6de6acc
|
@@ -56,9 +56,13 @@ module CC
|
|
56
56
|
@t_err = read_stderr(err)
|
57
57
|
t_timeout = timeout_thread
|
58
58
|
|
59
|
-
# blocks until the engine stops.
|
60
|
-
# it
|
61
|
-
|
59
|
+
# blocks until the engine stops. this is put in a thread so that we can
|
60
|
+
# explicitly abort it as part of #stop. otherwise a run-away container
|
61
|
+
# could still block here forever if the docker-kill/wait is not
|
62
|
+
# successful. there may still be stdout in flight if it was being
|
63
|
+
# produced more quickly than consumed.
|
64
|
+
@t_wait = Thread.new { _, @status = Process.waitpid2(pid) }
|
65
|
+
@t_wait.join
|
62
66
|
|
63
67
|
# blocks until all readers are done. they're still governed by the
|
64
68
|
# timeout thread at this point. if we hit the timeout while processing
|
@@ -71,11 +75,11 @@ module CC
|
|
71
75
|
@listener.timed_out(container_data(duration: duration))
|
72
76
|
else
|
73
77
|
duration = ((Time.now - started) * 1000).round
|
74
|
-
@listener.finished(container_data(duration: duration, status: status))
|
78
|
+
@listener.finished(container_data(duration: duration, status: @status))
|
75
79
|
end
|
76
80
|
|
77
81
|
Result.new(
|
78
|
-
status.exitstatus,
|
82
|
+
@status && @status.exitstatus,
|
79
83
|
@timed_out,
|
80
84
|
duration,
|
81
85
|
@maximum_output_exceeded,
|
@@ -90,6 +94,7 @@ module CC
|
|
90
94
|
def stop(message = nil)
|
91
95
|
reap_running_container(message)
|
92
96
|
kill_reader_threads
|
97
|
+
kill_wait_thread
|
93
98
|
end
|
94
99
|
|
95
100
|
private
|
@@ -170,6 +175,10 @@ module CC
|
|
170
175
|
@t_err.kill if @t_err
|
171
176
|
end
|
172
177
|
|
178
|
+
def kill_wait_thread
|
179
|
+
@t_wait.kill if @t_wait
|
180
|
+
end
|
181
|
+
|
173
182
|
def reap_running_container(message)
|
174
183
|
Analyzer.logger.warn("killing container name=#{@name} message=#{message.inspect}")
|
175
184
|
POSIX::Spawn::Child.new("docker", "kill", @name, timeout: 2.minutes)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: codeclimate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.35.
|
4
|
+
version: 0.35.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Code Climate
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-08-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|