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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 83778c10be3ccd8ed8b61d607d5e742f2b727f01a2ee16149cf298a70585a083
4
- data.tar.gz: 14eb47ac328d93b39517b74210f6a4d26b22afa13aefa42df105e2d9e55d16b1
3
+ metadata.gz: 45498b6ccc16a193e4562b68437909aa982613b11a3959608de293246edc1f31
4
+ data.tar.gz: fa3b269ba5e24b5500fb05409a6c5835127adf8cbda92bff54cc661358e10921
5
5
  SHA512:
6
- metadata.gz: fc053221b626ecfbec43f512442547d151737dc8894efb15a4ab53e9f651d5597162206dd1260c43a6d5a0599d39edb2bd37cb21ab0a3c415ee44b9f42b68117
7
- data.tar.gz: 36ae31abb21e0ee9bc7db47fc881de4ba2ddd3b0aa13b8878ae639cf96e8c56b0bfb561cb34074ee2d10b65e8bcdb5bd4e678d48a7bf1d9527774a525d43eb98
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
- Console.debug(self, "Waiting for children...", duration: duration, running: @running)
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:
@@ -5,6 +5,6 @@
5
5
 
6
6
  module Async
7
7
  module Container
8
- VERSION = "0.23.0"
8
+ VERSION = "0.23.1"
9
9
  end
10
10
  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.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
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: async-container
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.23.0
4
+ version: 0.23.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
metadata.gz.sig CHANGED
Binary file