Bug #17791
closed
Ractor exception when using Nokogiri
Added by tomanderson (Thomas Ender) about 3 years ago.
Updated about 3 years ago.
Description
Parsing xml using nokogiri:
doc = Nokogiri.XML('<foo><bar /></foo>', nil, 'EUC-JP')
Suppose I want to parse 4 xmls with 4 ractors, it will raise an unsafe exception:
Ractor::UnsafeError: ractor unsafe method called from not main ractor
the ruby version is 3.0.1.
I wonder if there is any way to avoid this.
This is because a function (read_memory
) in a C extension (nokogiri.so
) is called which is not marked as ractor-safe (see Feature #17307).
A workaround would be to mark it so, although I don't know if it is truly ractor-safe.
- Status changed from Open to Rejected
Based on @xtkoba's analysis, closing as this doesn't appear to be a bug in Ruby.
- Description updated (diff)
- Status changed from Rejected to Third Party's Issue
Also available in: Atom
PDF
Like0
Like0Like0Like0