selective-ruby-core 0.2.13-x86_64-linux → 0.2.14-x86_64-linux
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/selective/ruby/core/controller.rb +20 -0
- data/lib/selective/ruby/core/version.rb +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: d9cc71650828dee2971121fbf9470f4d6b5098a0cf3665d28cbc8418ea833e75
|
|
4
|
+
data.tar.gz: 54657519c20cd4d7098c04883e865710ff7f515c6f8bb8b819c0d8e70208d50c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e8d4331f13df6f9b79d2f33e43449dd03599a234d7a1bb2d03b48760db0a2434e334140bd1b8f59fbfa56e21b30d70d5569f16b3c50718c02a4772b15e3043b9
|
|
7
|
+
data.tar.gz: 38b4a40527d576c665eee9a8852ca0387deb003c744277ae44f50b18aa28dcd8f1352826c2c5b20fe4153e170ccdc2b6f8e793ea931e132ec7d7abe671a3b24e
|
|
@@ -10,6 +10,8 @@ module Selective
|
|
|
10
10
|
@@selective_suppress_reporting = false
|
|
11
11
|
@@report_at_finish = {}
|
|
12
12
|
|
|
13
|
+
TERMINATION_REPORT_GRACE = 0.25
|
|
14
|
+
|
|
13
15
|
REQUIRED_CONFIGURATION = {
|
|
14
16
|
"host" => "SELECTIVE_HOST",
|
|
15
17
|
"api_key" => "SELECTIVE_API_KEY",
|
|
@@ -256,12 +258,30 @@ module Selective
|
|
|
256
258
|
def handle_termination_signals(pid)
|
|
257
259
|
["INT", "TERM"].each do |signal|
|
|
258
260
|
Signal.trap(signal) do
|
|
261
|
+
report_termination(signal)
|
|
259
262
|
kill_transport(signal: signal)
|
|
260
263
|
exit(runner.exit_status)
|
|
261
264
|
end
|
|
262
265
|
end
|
|
263
266
|
end
|
|
264
267
|
|
|
268
|
+
# Tells the server this runner is being stopped on purpose, so a run
|
|
269
|
+
# whose runners all leave this way is recorded as cancelled rather
|
|
270
|
+
# than as runners lost. Best effort: a server that predates the
|
|
271
|
+
# message ignores it, and a dead pipe just means it isn't sent.
|
|
272
|
+
#
|
|
273
|
+
# The transport exits the moment it reads "exit", without draining
|
|
274
|
+
# what it has queued for the socket, so give it a moment to send this
|
|
275
|
+
# first. CI cancellations allow several seconds between TERM and KILL.
|
|
276
|
+
def report_termination(signal)
|
|
277
|
+
return unless pipe
|
|
278
|
+
|
|
279
|
+
write({type: "terminating", data: {signal: signal}})
|
|
280
|
+
sleep(TERMINATION_REPORT_GRACE)
|
|
281
|
+
rescue ConnectionLostError, IOError, SystemCallError
|
|
282
|
+
# Nothing to report to.
|
|
283
|
+
end
|
|
284
|
+
|
|
265
285
|
def kill_transport(signal: "TERM")
|
|
266
286
|
begin
|
|
267
287
|
pipe.write "exit"
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: selective-ruby-core
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.14
|
|
5
5
|
platform: x86_64-linux
|
|
6
6
|
authors:
|
|
7
7
|
- Benjamin Wood
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: exe
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2026-10-
|
|
12
|
+
date: 2026-10-10 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: logger
|
|
@@ -93,7 +93,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
93
93
|
- !ruby/object:Gem::Version
|
|
94
94
|
version: '0'
|
|
95
95
|
requirements: []
|
|
96
|
-
rubygems_version: 3.
|
|
96
|
+
rubygems_version: 3.5.22
|
|
97
97
|
signing_key:
|
|
98
98
|
specification_version: 4
|
|
99
99
|
summary: Selective Ruby Client Core
|