tins icon indicating copy to clipboard operation
tins copied to clipboard

`ThreadError: can't be called from trap context` in ThreadLocal

Open jaynetics opened this issue 2 years ago • 0 comments

caused by this call to Mutex#synchronize: https://github.com/flori/tins/blob/2c13fbcc114bf2d104297a3189042d047b6a6046/lib/tins/thread_local.rb#L7

this affects e.g. mize through its railtie.

i suspect this finalizer always failed but the failure only became visible with this change in Ruby 3.1: https://github.com/ruby/ruby/commit/fc4dd45d0142221880d1b2c9b54dee0597be2b78

i'm wondering whether the mutex is actually needed or it could simple be removed. if there is some order-dependency, maybe it can be satisfied like so: https://github.com/mongodb/mongo-ruby-driver/commit/3c675eaad6e892dc5e51c11e6c7ca870958a46af

jaynetics avatar Jul 12 '22 08:07 jaynetics