Title: Ractor incompatibility: DefaultFactory not shareable, C extension methods marked ractor-unsafe · Issue #390 · msgpack/msgpack-ruby · GitHub
Open Graph Title: Ractor incompatibility: DefaultFactory not shareable, C extension methods marked ractor-unsafe · Issue #390 · msgpack/msgpack-ruby
X Title: Ractor incompatibility: DefaultFactory not shareable, C extension methods marked ractor-unsafe · Issue #390 · msgpack/msgpack-ruby
Description: The msgpack gem (1.8.0) cannot be used inside Ractors on Ruby 4.0. Every operation - MessagePack.pack, .unpack, creating Packer/Unpacker/Factory instances - fails. This makes it impossible to use Ractors for parallel MessagePack serializ...
Open Graph Description: The msgpack gem (1.8.0) cannot be used inside Ractors on Ruby 4.0. Every operation - MessagePack.pack, .unpack, creating Packer/Unpacker/Factory instances - fails. This makes it impossible to use R...
X Description: The msgpack gem (1.8.0) cannot be used inside Ractors on Ruby 4.0. Every operation - MessagePack.pack, .unpack, creating Packer/Unpacker/Factory instances - fails. This makes it impossible to use R...
Opengraph URL: https://github.com/msgpack/msgpack-ruby/issues/390
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Ractor incompatibility: DefaultFactory not shareable, C extension methods marked ractor-unsafe","articleBody":"The `msgpack` gem (1.8.0) cannot be used inside [Ractors](https://docs.ruby-lang.org/en/master/Ractor.html) on Ruby 4.0. Every operation - `MessagePack.pack`, `.unpack`, creating `Packer`/`Unpacker`/`Factory` instances - fails. This makes it impossible to use Ractors for parallel MessagePack serialization/deserialization.\n\n```ruby\n#!/usr/bin/env ruby\n# frozen_string_literal: true\n\n# POC: msgpack gem 1.8.x is incompatible with Ruby 4.0 Ractors\n\nrequire \"bundler/inline\"\n\ngemfile(true) do\n source \"https://rubygems.org\"\n gem \"msgpack\", \"~\u003e 1.8\"\nend\n\nrequire \"msgpack\"\n\nputs \"Ruby #{RUBY_VERSION}, msgpack #{MessagePack::VERSION}\"\nputs \"-\" * 50\n\ntests = {\n \"MessagePack.pack\" =\u003e -\u003e { Ractor.new { MessagePack.pack({\"a\" =\u003e 1}) }.value },\n \"MessagePack.unpack\" =\u003e -\u003e { Ractor.new(MessagePack.pack(\"hi\")) { |d| MessagePack.unpack(d) }.value },\n \"Packer.new in Ractor\" =\u003e -\u003e { Ractor.new { MessagePack::Packer.new.write(\"x\").to_s }.value },\n \"Unpacker.new in Ractor\" =\u003e -\u003e { Ractor.new(MessagePack.pack(1)) { |d| u = MessagePack::Unpacker.new; u.feed(d); u.read }.value },\n \"Factory.new in Ractor\" =\u003e -\u003e { Ractor.new { MessagePack::Factory.new }.value },\n \"Send Packer to Ractor\" =\u003e -\u003e { Ractor.new(MessagePack::Packer.new) { |p| p.to_s }.value },\n \"Access DefaultFactory\" =\u003e -\u003e { Ractor.new { MessagePack::DefaultFactory }.value },\n}\n\ntests.each do |name, test|\n print \"#{name}: \"\n begin\n test.call\n puts \"OK\"\n rescue Ractor::RemoteError =\u003e e\n puts \"FAILED — #{e.cause.class}: #{e.cause.message}\"\n rescue =\u003e e\n puts \"FAILED — #{e.class}: #{e.message}\"\n end\nend\n```","author":{"url":"https://github.com/mensfeld","@type":"Person","name":"mensfeld"},"datePublished":"2026-05-08T15:05:03.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/390/msgpack-ruby/issues/390"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:0d3ea2dc-4d94-4043-337f-d564e8cfc24d |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C1A0:1B3B59:363695E:4BC2AF4:6A635ADE |
| html-safe-nonce | 4524341014139196e82cbe90b4d1544ecddf0784235bbd85a4807f6388d26383 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMUEwOjFCM0I1OTozNjM2OTVFOjRCQzJBRjQ6NkE2MzVBREUiLCJ2aXNpdG9yX2lkIjoiOTEyMzc4NTU0Njc3NTM1NDA3OCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | eeca4cf44b64ece44a27aa8a5f00bcad0712075b4f3ac6b3f1ed183c47d6d12c |
| hovercard-subject-tag | issue:4407345959 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/msgpack/msgpack-ruby/390/issue_layout |
| twitter:image | https://opengraph.githubassets.com/f673334253695be36f7847fcea95255b34a468538bff78652cd27fd4dc8d4403/msgpack/msgpack-ruby/issues/390 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/f673334253695be36f7847fcea95255b34a468538bff78652cd27fd4dc8d4403/msgpack/msgpack-ruby/issues/390 |
| og:image:alt | The msgpack gem (1.8.0) cannot be used inside Ractors on Ruby 4.0. Every operation - MessagePack.pack, .unpack, creating Packer/Unpacker/Factory instances - fails. This makes it impossible to use R... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | mensfeld |
| hostname | github.com |
| expected-hostname | github.com |
| None | 59e55daad7174ca59d63c6974d58276ccb5477442e550bebb3c035e1bef11c94 |
| turbo-cache-control | no-preview |
| go-import | github.com/msgpack/msgpack-ruby git https://github.com/msgpack/msgpack-ruby.git |
| octolytics-dimension-user_id | 198264 |
| octolytics-dimension-user_login | msgpack |
| octolytics-dimension-repository_id | 2479813 |
| octolytics-dimension-repository_nwo | msgpack/msgpack-ruby |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 2479813 |
| octolytics-dimension-repository_network_root_nwo | msgpack/msgpack-ruby |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 990295d92a4cc7b63fbbd83a046217cd7d77d49c |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width