async-container 0.27.1 → 0.27.2
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 +10 -11
- data/lib/async/container/generic.rb +15 -4
- 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 +2 -2
- 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: 7d43fc927cb1564c1ed256976873b66245386fe54d11467935184c1f38da9d96
|
4
|
+
data.tar.gz: 3738e9b3009bd87388fe23c34085d99a4ba384fe8ef274465ec732a8398f6b7b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 14700cf9cb8952affd49569383348715fa357660b809f033a1a0d345a03f3b16145ec868b07022df1bece5224008a49ce78441d86113ef18c94530247fadf104
|
7
|
+
data.tar.gz: 7665c5a66280b04bd835e9708e81fff08ab5116ab07886fae1aa3c3b155bef6011167d10bcdb63b08c3a877d5df795dd3901740a0e46ac0a433ff7cf024feac1
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
@@ -91,11 +91,11 @@ module Async
|
|
91
91
|
# Start the container unless it's already running.
|
92
92
|
def start
|
93
93
|
unless @container
|
94
|
-
Console.info(self
|
94
|
+
Console.info(self, "Controller starting...")
|
95
95
|
self.restart
|
96
96
|
end
|
97
97
|
|
98
|
-
Console.info(self
|
98
|
+
Console.info(self, "Controller started...")
|
99
99
|
end
|
100
100
|
|
101
101
|
# Stop the container if it's running.
|
@@ -111,9 +111,9 @@ module Async
|
|
111
111
|
if @container
|
112
112
|
@notify&.restarting!
|
113
113
|
|
114
|
-
Console.
|
114
|
+
Console.info(self, "Restarting container...")
|
115
115
|
else
|
116
|
-
Console.
|
116
|
+
Console.info(self, "Starting container...")
|
117
117
|
end
|
118
118
|
|
119
119
|
container = self.create_container
|
@@ -127,13 +127,14 @@ module Async
|
|
127
127
|
end
|
128
128
|
|
129
129
|
# Wait for all child processes to enter the ready state.
|
130
|
-
Console.
|
130
|
+
Console.info(self, "Waiting for startup...")
|
131
131
|
container.wait_until_ready
|
132
|
-
Console.
|
132
|
+
Console.info(self, "Finished startup.")
|
133
133
|
|
134
134
|
if container.failed?
|
135
135
|
@notify&.error!("Container failed to start!")
|
136
136
|
|
137
|
+
Console.info(self, "Stopping failed container...")
|
137
138
|
container.stop(false)
|
138
139
|
|
139
140
|
raise SetupError, container
|
@@ -145,7 +146,7 @@ module Async
|
|
145
146
|
container = nil
|
146
147
|
|
147
148
|
if old_container
|
148
|
-
Console.
|
149
|
+
Console.info(self, "Stopping old container...")
|
149
150
|
old_container&.stop(@graceful_stop)
|
150
151
|
end
|
151
152
|
|
@@ -168,11 +169,9 @@ module Async
|
|
168
169
|
end
|
169
170
|
|
170
171
|
# Wait for all child processes to enter the ready state.
|
171
|
-
Console.
|
172
|
-
|
172
|
+
Console.info(self, "Waiting for startup...")
|
173
173
|
@container.wait_until_ready
|
174
|
-
|
175
|
-
Console.debug(self, "Finished startup.")
|
174
|
+
Console.info(self, "Finished startup.")
|
176
175
|
|
177
176
|
if @container.failed?
|
178
177
|
@notify.error!("Container failed to reload!")
|
@@ -139,12 +139,18 @@ module Async
|
|
139
139
|
# Stop the children instances.
|
140
140
|
# @parameter timeout [Boolean | Numeric] Whether to stop gracefully, or a specific timeout.
|
141
141
|
def stop(timeout = true)
|
142
|
+
Console.info(self, "Stopping container...", timeout: timeout, caller: caller_locations)
|
142
143
|
@running = false
|
143
144
|
@group.stop(timeout)
|
144
145
|
|
145
146
|
if @group.running?
|
146
|
-
Console.warn(self
|
147
|
+
Console.warn(self, "Group is still running after stopping it!")
|
148
|
+
else
|
149
|
+
Console.info(self, "Group has stopped.")
|
147
150
|
end
|
151
|
+
rescue => error
|
152
|
+
Console.error(self, "Error while stopping container!", exception: error)
|
153
|
+
raise
|
148
154
|
ensure
|
149
155
|
@running = true
|
150
156
|
end
|
@@ -165,7 +171,7 @@ module Async
|
|
165
171
|
name ||= UNNAMED
|
166
172
|
|
167
173
|
if mark?(key)
|
168
|
-
Console.debug(self
|
174
|
+
Console.debug(self, "Reusing existing child.", child: {key: key, name: name})
|
169
175
|
return false
|
170
176
|
end
|
171
177
|
|
@@ -199,10 +205,10 @@ module Async
|
|
199
205
|
end
|
200
206
|
|
201
207
|
if status.success?
|
202
|
-
Console.
|
208
|
+
Console.info(self, "Child exited successfully.", status: status, running: @running)
|
203
209
|
else
|
204
210
|
@statistics.failure!
|
205
|
-
Console.error(self, status: status)
|
211
|
+
Console.error(self, "Child exited with error!", status: status, running: @running)
|
206
212
|
end
|
207
213
|
|
208
214
|
if restart
|
@@ -211,6 +217,11 @@ module Async
|
|
211
217
|
break
|
212
218
|
end
|
213
219
|
end
|
220
|
+
rescue => error
|
221
|
+
Console.error(self, "Failure during child process management!", exception: error, running: @running)
|
222
|
+
raise
|
223
|
+
ensure
|
224
|
+
Console.info(self, "Child process management loop exited.", running: @running)
|
214
225
|
end.resume
|
215
226
|
|
216
227
|
return true
|
data/readme.md
CHANGED
@@ -26,6 +26,10 @@ Please see the [project documentation](https://socketry.github.io/async-containe
|
|
26
26
|
|
27
27
|
Please see the [project releases](https://socketry.github.io/async-container/releases/index) for all releases.
|
28
28
|
|
29
|
+
### v0.27.2
|
30
|
+
|
31
|
+
- More logging, especially around failure cases.
|
32
|
+
|
29
33
|
### v0.27.1
|
30
34
|
|
31
35
|
- Log caller and timeout when waiting on a child instance to exit, if it blocks.
|
data/releases.md
CHANGED
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.27.
|
4
|
+
version: 0.27.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
@@ -105,7 +105,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
105
105
|
- !ruby/object:Gem::Version
|
106
106
|
version: '0'
|
107
107
|
requirements: []
|
108
|
-
rubygems_version: 3.
|
108
|
+
rubygems_version: 3.7.2
|
109
109
|
specification_version: 4
|
110
110
|
summary: Abstract container-based parallelism using threads and processes where appropriate.
|
111
111
|
test_files: []
|
metadata.gz.sig
CHANGED
Binary file
|