Skip to content

Commit 6ad1df3

Browse files
Collect inherited objects after fork.
Assisted-By: devx/3236e566-7538-432e-a30a-2bdf37265ed4
1 parent b6d5363 commit 6ad1df3

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

lib/async/container/forked.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,9 @@ def self.fork(**options)
111111

112112
# Reset `SignalException` delivery because CRuby inherits the `Thread.handle_interrupt` mask stack across `Thread.new`. Async deliberately masks signal exceptions, and the signal traps above should be delivered promptly:
113113
::Thread.handle_interrupt(SignalException => :immediate) do
114+
# Collect inherited, unreachable parent objects before user code can create a new scheduler or other descriptors which might reuse inherited descriptor numbers.
115+
GC.start
116+
114117
yield Instance.for(process)
115118
rescue Interrupt
116119
# Graceful exit.

0 commit comments

Comments
 (0)