Kernel#exit is basically just raise SystemExit, does it mean any exception in a Ractor hangs?
IOW, I don't think it should be disallowed because exit is just an Exception.
./miniruby -e 'Ractor.new { exit }.join'
-e:1: warning: Ractor is experimental, and the behavior may change in future versions of Ruby! Also there are many implementation issues.
-e:1:in 'Ractor#join': thrown by remote Ractor. (Ractor::RemoteError)
from -e:1:in '<main>'
-e:1:in 'Kernel#exit': exit (SystemExit)
from -e:1:in 'block in <main>'
In this PR we end up wrapping SystemExit in a Ractor::RemoteError rather than exiting the program. I don't know if that's the most desirable behaviour (versus translating back to SystemExit), but it makes sense to me as calling exit in a Ractor is a bit strange.
Previously Ractor.new { exit }.join would hang because SystemExit was
special cased.
This commit updates this to take the same path as other exceptions,
which wraps the exception in a Ractor::RemoteError and does not end up
exiting the main Ractor. I don't know if that's what this should do, but
I think it's a reasonable behaviour as calling exit() in a Ractor is
odd.
in 'Ractor#join': thrown by remote Ractor. (Ractor::RemoteError)
from -e:1:in '<main>'
in 'Kernel#exit': exit (SystemExit)
from -e:1:in 'block in <main>'