async-container 0.20.1 → 0.21.0
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
- checksums.yaml.gz.sig +0 -0
- data/lib/async/container/forked.rb +7 -0
- data/lib/async/container/generic.rb +2 -2
- data/lib/async/container/threaded.rb +12 -1
- data/lib/async/container/version.rb +1 -1
- data/readme.md +4 -0
- data/releases.md +4 -0
- data.tar.gz.sig +0 -0
- metadata +1 -1
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6dd27e02912c5f1258419c9821da1bd97d58f4fd68b4a58512b3ebd5291c5b6b
|
4
|
+
data.tar.gz: 36fc9d2d0ce94a0e2591beac3384d2fba288094a93c1ada7a9000841c1e78a59
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 162f3604bbaa973b486fc271ccf61106008a5d2259f114134535188349267ee3dfb81cbe857ce7edc49dd2037b5d1f5581dd531955ddbfba264a113638e300cd
|
7
|
+
data.tar.gz: b1ba5f8e3b96976a97b6f81e20a62efbcbde89e4e2f0be43c754954a44924e2553c447cf275121ce74894d0044e7677a144c7f43df5f77d7a55b263f6442eb96
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
@@ -172,8 +172,8 @@ module Async
|
|
172
172
|
when :health_check!
|
173
173
|
if health_check_timeout&.<(age_clock.total)
|
174
174
|
Console.warn(self, "Child failed health check!", child: child, age: age_clock.total, health_check_timeout: health_check_timeout)
|
175
|
-
# If the child has failed the health check, we assume the worst and
|
176
|
-
child.
|
175
|
+
# If the child has failed the health check, we assume the worst and kill it immediately:
|
176
|
+
child.kill!
|
177
177
|
end
|
178
178
|
else
|
179
179
|
state.update(message)
|
@@ -11,6 +11,9 @@ module Async
|
|
11
11
|
module Container
|
12
12
|
# A multi-thread container which uses {Thread.fork}.
|
13
13
|
class Threaded < Generic
|
14
|
+
class Kill < Exception
|
15
|
+
end
|
16
|
+
|
14
17
|
# Indicates that this is not a multi-process container.
|
15
18
|
def self.multiprocess?
|
16
19
|
false
|
@@ -178,6 +181,14 @@ module Async
|
|
178
181
|
@thread.raise(Terminate)
|
179
182
|
end
|
180
183
|
|
184
|
+
# Invoke {Thread#kill} on the child thread.
|
185
|
+
def kill!
|
186
|
+
# Killing a thread does not raise an exception in the thread, so we need to handle the status here:
|
187
|
+
@status = Status.new(:killed)
|
188
|
+
|
189
|
+
@thread.kill
|
190
|
+
end
|
191
|
+
|
181
192
|
# Raise {Restart} in the child thread.
|
182
193
|
def restart!
|
183
194
|
@thread.raise(Restart)
|
@@ -230,7 +241,7 @@ module Async
|
|
230
241
|
Console.error(self) {error}
|
231
242
|
end
|
232
243
|
|
233
|
-
@status
|
244
|
+
@status ||= Status.new(error)
|
234
245
|
self.close_write
|
235
246
|
end
|
236
247
|
end
|
data/readme.md
CHANGED
@@ -22,6 +22,10 @@ Please see the [project documentation](https://socketry.github.io/async-containe
|
|
22
22
|
|
23
23
|
Please see the [project releases](https://socketry.github.io/async-container/releases/index) for all releases.
|
24
24
|
|
25
|
+
### v0.21.0
|
26
|
+
|
27
|
+
- Use `SIGKILL`/`Thread#kill` when the health check fails. In some cases, `SIGTERM` may not be sufficient to terminate a process because the signal can be ignored or the process may be in an uninterruptible state.
|
28
|
+
|
25
29
|
### v0.20.1
|
26
30
|
|
27
31
|
- Fix compatibility between <code class="language-ruby">Async::Container::Hybrid</code> and the health check.
|
data/releases.md
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
# Releases
|
2
2
|
|
3
|
+
## v0.21.0
|
4
|
+
|
5
|
+
- Use `SIGKILL`/`Thread#kill` when the health check fails. In some cases, `SIGTERM` may not be sufficient to terminate a process because the signal can be ignored or the process may be in an uninterruptible state.
|
6
|
+
|
3
7
|
## v0.20.1
|
4
8
|
|
5
9
|
- Fix compatibility between {ruby Async::Container::Hybrid} and the health check.
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
metadata.gz.sig
CHANGED
Binary file
|