Skip to content

Commit 93cec86

Browse files
Increase default graceful timeout.
1 parent 15d0b97 commit 93cec86

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lib/async/container/group.rb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ module Container
2323
end
2424

2525
# The default timeout for graceful termination.
26-
DEFAULT_GRACEFUL_TIMEOUT = 10.0
26+
DEFAULT_GRACEFUL_TIMEOUT = 30.0
2727

2828
# Manages a group of running processes.
2929
class Group
@@ -167,7 +167,7 @@ def kill
167167
# 1. Send SIGINT and wait up to `graceful` seconds if specified.
168168
# 2. Send SIGKILL and wait indefinitely for process cleanup.
169169
#
170-
# If `graceful` is true, default to `DEFAULT_GRACEFUL_TIMEOUT` (10 seconds).
170+
# If `graceful` is true, default to `DEFAULT_GRACEFUL_TIMEOUT` (30 seconds).
171171
# If `graceful` is false, skip the SIGINT phase and go directly to SIGKILL.
172172
#
173173
# @parameter graceful [Boolean | Numeric] Whether to send SIGINT first or skip directly to SIGKILL.
@@ -191,6 +191,10 @@ def stop(graceful = GRACEFUL_TIMEOUT)
191191
ensure
192192
# Do our best to clean up the children:
193193
if any?
194+
if graceful
195+
Console.warn(self, "Killing processes after graceful shutdown failed...", size: self.size, clock: clock)
196+
end
197+
194198
self.kill
195199
self.wait
196200
end

0 commit comments

Comments
 (0)