Commit c13fe54
committed
Downgrade rb_ractor_make_shareable to a warning under check_isolation
Etienne's reference-chain refactor (5fd43a3) moved the raise out of
the per-object check callback and into rb_ractor_make_shareable
itself, where it builds the exception locally and rb_exc_raise's
directly. That bypassed rb_ractor_isolation_violation, so under
Ractor.check_isolation a non-shareable Proc passed to
Ractor.make_shareable was crashing again instead of warning.
Restore the downgrade by branching on rb_thread_ractor_isolation_check_p
inside rb_ractor_make_shareable: in check mode, format the exception's
message together with the chain and emit a :ractor_isolation warning;
otherwise attach the chain to @reference_chain and rb_exc_raise as
before.
The chain is appended inline in the warning message because there is
no exception object to hang @reference_chain off of. This keeps the
chain visible to anyone reading stderr without inventing a parallel
warning-with-attached-data API.1 parent 874a423 commit c13fe54
1 file changed
Lines changed: 15 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1656 | 1656 | | |
1657 | 1657 | | |
1658 | 1658 | | |
1659 | | - | |
| 1659 | + | |
| 1660 | + | |
| 1661 | + | |
| 1662 | + | |
| 1663 | + | |
| 1664 | + | |
| 1665 | + | |
| 1666 | + | |
| 1667 | + | |
| 1668 | + | |
| 1669 | + | |
| 1670 | + | |
| 1671 | + | |
| 1672 | + | |
| 1673 | + | |
1660 | 1674 | | |
1661 | 1675 | | |
1662 | 1676 | | |
1663 | 1677 | | |
1664 | 1678 | | |
1665 | | - | |
1666 | | - | |
1667 | | - | |
1668 | | - | |
1669 | | - | |
1670 | 1679 | | |
1671 | 1680 | | |
1672 | 1681 | | |
| |||
0 commit comments