Skip to content

Commit 59805b9

Browse files
Let ECHILD propagate from forked wait
Assisted-By: devx/3236e566-7538-432e-a30a-2bdf37265ed4
1 parent 93c2eea commit 59805b9

1 file changed

Lines changed: 3 additions & 22 deletions

File tree

lib/async/container/forked.rb

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -153,21 +153,6 @@ def initialize(name: nil, **options)
153153
self.close_write
154154
end
155155

156-
# A minimal status for children reaped outside this object.
157-
class Status
158-
def success?
159-
true
160-
end
161-
162-
def to_i
163-
0
164-
end
165-
166-
def to_s
167-
"\#<#{self.class} success>"
168-
end
169-
end
170-
171156
# Convert the child process to a hash, suitable for serialization.
172157
#
173158
# @returns [Hash] The request as a hash.
@@ -253,13 +238,9 @@ def restart!
253238
# @parameter timeout [Numeric | Nil] Ignored; retained for compatibility.
254239
# @returns [::Process::Status] The process exit status.
255240
def wait(timeout = nil)
256-
begin
257-
if @pid && @status.nil?
258-
Console.debug(self, "Waiting for process to exit...", child: {process_id: @pid})
259-
_, @status = ::Process.wait2(@pid)
260-
end
261-
rescue Errno::ECHILD
262-
@status = Status.new
241+
if @pid && @status.nil?
242+
Console.debug(self, "Waiting for process to exit...", child: {process_id: @pid})
243+
_, @status = ::Process.wait2(@pid)
263244
end
264245

265246
Console.debug(self, "Process exited.", child: {process_id: @pid, status: @status})

0 commit comments

Comments
 (0)