Project

General

Profile

Actions

Bug #20078

closed

StringIO cannot be moved between Ractors

Added by forthoney (Seong-Heon Jung) 6 months ago. Updated 6 months ago.

Status:
Closed
Assignee:
-
Target version:
-
[ruby-core:115845]

Description

The following code will raise an unusual Ractor error.

require 'stringio'
r = Ractor.new { loop { Ractor.receive } }
Ractor.shareable?(StringIO.new) #=> false
r.send(StringIO.new) # passing it via copy works
r.send(StringIO.new, move: true) # <internal:ractor>:587:in `send': can not move StringIO object. (Ractor::Error)

I'm not 100% sure but I believe that this probably not the intended behavior considering

  • The error raised is a generic Ractor::Error rather than something specific like Ractor::MovedError or Ractor::IsolationError
  • It can be copied
  • No documentation exists for this error
  • I have yet to seen this happen on any other class instance
  • Typo (can not -> cannot)
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like1Like1Like0Like0