async-container 0.23.0 → 0.23.1
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/controller.rb +2 -2
- data/lib/async/container/generic.rb +5 -0
- data/lib/async/container/group.rb +7 -1
- data/lib/async/container/version.rb +1 -1
- data/readme.md +4 -0
- data/releases.md +21 -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: 45498b6ccc16a193e4562b68437909aa982613b11a3959608de293246edc1f31
|
4
|
+
data.tar.gz: fa3b269ba5e24b5500fb05409a6c5835127adf8cbda92bff54cc661358e10921
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4481f2950cfacc074c010419ce3afaa785435df9066b072e4d514a7ea3319fd930242afb8ef0f3e40020d7674209d792a4a42059f1f44cdc3270669bca52ef7b
|
7
|
+
data.tar.gz: '018f892e9b7b9cd7703ce0b9e15a8eb689804563b8d691a676f51a0ad79b0d78681d34bca2c63da9e508c8b48dc617cb03dde3911af5271e42997a334dcf06bd'
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
@@ -149,7 +149,7 @@ module Async
|
|
149
149
|
old_container&.stop(@graceful_stop)
|
150
150
|
end
|
151
151
|
|
152
|
-
@notify&.ready!
|
152
|
+
@notify&.ready!(size: @container.size)
|
153
153
|
ensure
|
154
154
|
# If we are leaving this function with an exception, try to kill the container:
|
155
155
|
container&.stop(false)
|
@@ -185,7 +185,7 @@ module Async
|
|
185
185
|
|
186
186
|
# Enter the controller run loop, trapping `SIGINT` and `SIGTERM`.
|
187
187
|
def run
|
188
|
-
@notify&.status!("Initializing...")
|
188
|
+
@notify&.status!("Initializing controller...")
|
189
189
|
|
190
190
|
with_signal_handlers do
|
191
191
|
self.start
|
@@ -51,6 +51,11 @@ module Async
|
|
51
51
|
# @attribute [Group] The group of running children instances.
|
52
52
|
attr :group
|
53
53
|
|
54
|
+
# @returns [Integer] The number of running children instances.
|
55
|
+
def size
|
56
|
+
@group.size
|
57
|
+
end
|
58
|
+
|
54
59
|
# @attribute [Hash(Child, Hash)] The state of each child instance.
|
55
60
|
attr :state
|
56
61
|
|
@@ -32,6 +32,11 @@ module Async
|
|
32
32
|
# @attribute [Hash(IO, Fiber)] the running tasks, indexed by IO.
|
33
33
|
attr :running
|
34
34
|
|
35
|
+
# @returns [Integer] The number of running processes.
|
36
|
+
def size
|
37
|
+
@running.size
|
38
|
+
end
|
39
|
+
|
35
40
|
# Whether the group contains any running processes.
|
36
41
|
# @returns [Boolean]
|
37
42
|
def running?
|
@@ -175,7 +180,8 @@ module Async
|
|
175
180
|
protected
|
176
181
|
|
177
182
|
def wait_for_children(duration = nil)
|
178
|
-
|
183
|
+
# This log is a big noisy and doesn't really provide a lot of useful information.
|
184
|
+
# Console.debug(self, "Waiting for children...", duration: duration, running: @running)
|
179
185
|
|
180
186
|
if !@running.empty?
|
181
187
|
# Maybe consider using a proper event loop here:
|
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.23.0
|
26
|
+
|
27
|
+
- [Add support for `NOTIFY_LOG` for Kubernetes readiness probes.](https://socketry.github.io/async-container/releases/index#add-support-for-notify_log-for-kubernetes-readiness-probes.)
|
28
|
+
|
25
29
|
### v0.21.0
|
26
30
|
|
27
31
|
- 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.
|
data/releases.md
CHANGED
@@ -1,5 +1,26 @@
|
|
1
1
|
# Releases
|
2
2
|
|
3
|
+
## v0.23.0
|
4
|
+
|
5
|
+
### Add support for `NOTIFY_LOG` for Kubernetes readiness probes.
|
6
|
+
|
7
|
+
You may specify a `NOTIFY_LOG` environment variable to enable readiness logging to a log file. This can be used for Kubernetes readiness probes, e.g.
|
8
|
+
|
9
|
+
``` yaml
|
10
|
+
containers:
|
11
|
+
- name: falcon
|
12
|
+
env:
|
13
|
+
- name: NOTIFY_LOG
|
14
|
+
value: "/tmp/notify.log"
|
15
|
+
command: ["falcon", "host"]
|
16
|
+
readinessProbe:
|
17
|
+
exec:
|
18
|
+
command: ["sh", "-c", "grep -q '\"ready\":true' /tmp/notify.log"]
|
19
|
+
initialDelaySeconds: 5
|
20
|
+
periodSeconds: 5
|
21
|
+
failureThreshold: 12
|
22
|
+
```
|
23
|
+
|
3
24
|
## v0.21.0
|
4
25
|
|
5
26
|
- 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.
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
metadata.gz.sig
CHANGED
Binary file
|