You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Notice that when a new Fiber is created, by default it "inherits a copy of the storage from the current fiber."
I realize that RequestStore does not specify how Fibers are created, and this made me wonder if there's a potential bug in using RequestStore since it may be hard to see how new Fibers are created in puma or thin. (Currently puma and thin use Thread.new)
The text was updated successfully, but these errors were encountered:
There is also a discussion in #96 (comment) that I think concerns the same underlying issue. Note that request_store 1.6.0 switched from thread local storage to fiber storage, which is what triggered the problem in my case.
I'm debugging an issue in PaperTrail and how it uses RequestStore.
I noticed that one of their tests failed with the switch from Ruby 3.1.5 to 3.2.0:
In the test they assert that a new thread would get a new RequestStore:
I'm able to update the test for RequestStore and Fiber like so:
Notice that when a new Fiber is created, by default it "inherits a copy of the storage from the current fiber."
I realize that RequestStore does not specify how Fibers are created, and this made me wonder if there's a potential bug in using RequestStore since it may be hard to see how new Fibers are created in puma or thin. (Currently puma and thin use Thread.new)
The text was updated successfully, but these errors were encountered: