tina4ruby 3.13.115 → 3.13.116
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/CHANGELOG.md +45 -0
- data/lib/tina4/service_runner.rb +26 -0
- data/lib/tina4/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2f87f8715c8f265ae840f6f060d9d31be518c45120cd83881be55c9bfa54ddee
|
|
4
|
+
data.tar.gz: 1435132552d0d98a2feecd3da65e1674cc5dce8753f56661a20c2d955c7187c0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a3dab7c63858f731fb06d8cd35a01497da574a528f32f602c2234a4ca43cfcd29612ed500a60d303d21f64bbaa3fa58e27622d921fb40cd4ca564ceccd8003d1
|
|
7
|
+
data.tar.gz: 40cc64acd13b62b74472aea5fcfe6557533ab61d1e6ba4d9c49d332882b388717966f54a475a0cc24e6d333def06da1f02abaa39b99ff0396ed0da180fbfd806
|
data/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,51 @@ number means the same thing everywhere.
|
|
|
6
6
|
**The authoritative release notes for every shipped version live in the documentation:**
|
|
7
7
|
https://tina4.com/ruby/36-releases
|
|
8
8
|
|
|
9
|
+
## 3.13.116
|
|
10
|
+
|
|
11
|
+
Cooperative service-runner shutdown + version-contract test hardening.
|
|
12
|
+
Parity with tina4-python #118, tina4-nodejs #58, and the tina4-php
|
|
13
|
+
port landing in this same release.
|
|
14
|
+
|
|
15
|
+
### ServiceRunner.stop calls the registered Tina4::Service instance
|
|
16
|
+
|
|
17
|
+
Before: `Tina4::ServiceRunner.stop(name)` only flipped `ctx.running =
|
|
18
|
+
false` on the ServiceContext and joined the worker thread; a
|
|
19
|
+
class-based Tina4::Service subclass whose #run looped on
|
|
20
|
+
`until should_stop?` never exited cooperatively because @running
|
|
21
|
+
(the ivar should_stop? reads) was untouched — the thread was killed
|
|
22
|
+
by thread.join(5) timeout, leaving the run loop still spinning.
|
|
23
|
+
|
|
24
|
+
Fix: BEFORE thread.join(5), iterate the target names and for each
|
|
25
|
+
@registry entry that carries an :instance responding to #stop,
|
|
26
|
+
call entry[:instance].stop cooperatively. Wrapped so a misbehaving
|
|
27
|
+
user-override cannot strand siblings. ctx.running-based
|
|
28
|
+
block-handler daemons keep working (fix is additive).
|
|
29
|
+
|
|
30
|
+
The docstring on register_service (service_runner.rb:53-55) has
|
|
31
|
+
claimed this exact wiring since v3 arrived — the code was missing.
|
|
32
|
+
|
|
33
|
+
Regression: `spec/service_runner_stop_class_instance_spec.rb` — real
|
|
34
|
+
Tina4::Service subclass, real register_service, real
|
|
35
|
+
ServiceRunner.stop; asserts the instance's should_stop? flips. Gate
|
|
36
|
+
proven by mutation (positive example fails without the fix).
|
|
37
|
+
|
|
38
|
+
### Version-contract test hardening
|
|
39
|
+
|
|
40
|
+
- `spec/version_contract_spec.rb`:
|
|
41
|
+
`VersionContractProbe.parse_cli_manifest(stdout, context)` locates
|
|
42
|
+
the first `{` in the child's stdout before JSON.parse, and raises
|
|
43
|
+
RuntimeError with a 400-char stdout slice on parse failure.
|
|
44
|
+
`cli_run` subprocess env now sets `RUBYOPT=-W0` so a child ruby
|
|
45
|
+
warning cannot leak onto stdout via any misconfigured require path.
|
|
46
|
+
- Both callsites (`spec/version_contract_spec.rb`,
|
|
47
|
+
`spec/commands_manifest_spec.rb`) routed through the resilient
|
|
48
|
+
parser.
|
|
49
|
+
- Two named regression examples: positive (polluted stdout still
|
|
50
|
+
parses) + negative (no-JSON stdout raises with context).
|
|
51
|
+
|
|
52
|
+
Parity: sibling Python / PHP / Node fixes landing alongside.
|
|
53
|
+
|
|
9
54
|
## 3.13.115
|
|
10
55
|
|
|
11
56
|
Parity version bump. No framework code changes in Ruby for this
|
data/lib/tina4/service_runner.rb
CHANGED
|
@@ -140,6 +140,32 @@ module Tina4
|
|
|
140
140
|
Tina4::Log.info("Service stopping: #{svc_name}")
|
|
141
141
|
end
|
|
142
142
|
|
|
143
|
+
# Cooperative shutdown of class-based Service instances — parity with
|
|
144
|
+
# tina4-python #118 and tina4-nodejs #58 (ead390c76). Must happen
|
|
145
|
+
# BEFORE thread.join(5) so a subclass's `until should_stop?` loop
|
|
146
|
+
# observes the flip and returns before the join times out. When
|
|
147
|
+
# invoked with a name, also fires for a registered-but-not-yet-
|
|
148
|
+
# started service — `targets` above is @contexts-derived and empty
|
|
149
|
+
# in that case, so without this the docstring's promise
|
|
150
|
+
# (register_service wires up #stop) would be honoured only for
|
|
151
|
+
# started services. Wrapped so one bad user-override #stop cannot
|
|
152
|
+
# strand siblings.
|
|
153
|
+
cooperative_names = if name
|
|
154
|
+
@registry.key?(name.to_s) ? [name.to_s] : []
|
|
155
|
+
else
|
|
156
|
+
targets.keys
|
|
157
|
+
end
|
|
158
|
+
cooperative_names.each do |svc_name|
|
|
159
|
+
entry = @registry[svc_name]
|
|
160
|
+
next unless entry && entry[:instance].respond_to?(:stop)
|
|
161
|
+
|
|
162
|
+
begin
|
|
163
|
+
entry[:instance].stop
|
|
164
|
+
rescue StandardError => e
|
|
165
|
+
Tina4::Log.error("ServiceRunner: #{svc_name}#stop raised: #{e.message}")
|
|
166
|
+
end
|
|
167
|
+
end
|
|
168
|
+
|
|
143
169
|
# Join threads with a timeout so we don't hang forever
|
|
144
170
|
targets.each_key do |svc_name|
|
|
145
171
|
thread = @threads[svc_name]
|
data/lib/tina4/version.rb
CHANGED