From: chris@... Date: 2020-11-20T00:02:06+00:00 Subject: [ruby-core:100952] [Ruby master Bug#17334] Marshal cannot dump instance of Monitor Issue #17334 has been updated by chrisseaton (Chris Seaton). I'm not sure what a dumped instance of `Monitor` would look like though? Its state implicitly includes the current stack trace of threads using it. What do you imagine an undumped `Monitor` with blocked threads would look like? ---------------------------------------- Bug #17334: Marshal cannot dump instance of Monitor https://bugs.ruby-lang.org/issues/17334#change-88606 * Author: Littlejd1997 (Jon David Schober) * Status: Rejected * Priority: Normal * ruby -v: 2.7.2 * Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN ---------------------------------------- I'm not really sure why, but I hope someone else know whats going on. I was digging into an error I had with Rails caching. Long story short, I was caching a HTTP::CookieJar object which has an instance variable of type Monitor. The rails cache uses Marshaling, which fails on Monitor instances ``` ruby 2.7.2 :005 > Marshal.dump(Monitor.new) Traceback (most recent call last): 6: from /Users/jondavid.schober/.rvm/rubies/ruby-2.7.2/bin/irb:23:in `
' 5: from /Users/jondavid.schober/.rvm/rubies/ruby-2.7.2/bin/irb:23:in `load' 4: from /Users/jondavid.schober/.rvm/rubies/ruby-2.7.2/lib/ruby/gems/2.7.0/gems/irb-1.2.6/exe/irb:11:in `' 3: from (irb):4 2: from (irb):5:in `rescue in irb_binding' 1: from (irb):5:in `dump' TypeError (no _dump_data is defined for class Monitor) 2.7.2 :006 > ``` -- https://bugs.ruby-lang.org/ Unsubscribe: