Skip to content

Commit a91391b

Browse files
Extra logging.
1 parent 15d0b97 commit a91391b

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

lib/async/container/group.rb

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,24 +173,27 @@ def kill
173173
# @parameter graceful [Boolean | Numeric] Whether to send SIGINT first or skip directly to SIGKILL.
174174
def stop(graceful = GRACEFUL_TIMEOUT)
175175
Console.info(self, "Stopping all processes...", graceful: graceful)
176-
176+
clock = Clock.start
177+
177178
# If a timeout is specified, interrupt the children first:
178179
if graceful
180+
$stderr.puts "[Group] Interrupting all processes... clock=#{clock.total}"
179181
# Send SIGINT to the children:
180182
self.interrupt
181183

182184
if graceful == true
183185
graceful = DEFAULT_GRACEFUL_TIMEOUT
184186
end
185187

186-
clock = Clock.start
187-
188188
# Wait for the children to exit:
189+
$stderr.puts "[Group] Waiting for children to exit... clock=#{clock.total} size=#{self.size} graceful=#{graceful}"
189190
self.wait_for_exit(clock, graceful)
191+
$stderr.puts "[Group] Children exited... clock=#{clock.total} size=#{self.size}"
190192
end
191193
ensure
192194
# Do our best to clean up the children:
193195
if any?
196+
$stderr.puts "[Group] Killing all processes... clock=#{clock.total}"
194197
self.kill
195198
self.wait
196199
end

0 commit comments

Comments
 (0)