Actions
Bug #19374
openIssue with Ractor.make_shareable with curried procs
Description
This works, but shouldn't:
class Worker
def start(&blk)
blk = blk.curry # bug in ruby allows sharing of non-shareable proc
Ractor.make_shareable(blk)
@ractor = Ractor.new(blk) do |b|
main = b.call
p "from ractor: #{main}"
end
end
def work
@ractor.take
end
end
worker = Worker.new
a = self # unshareable main object
p "from main: #{a}"
worker.start { a }
worker.work
The curried proc has a reference to the original proc and it's not checked for shareability.
Actions
Like0
Like0Like0