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
When using puma with Rack::Cache, the assets do not get loaded correctly, this issue is described on the puma project: puma/puma#57
I found out that puma sets env['rack.run_once'] to true and rack-cache uses this information to determine to run the request on a non threadsafe mode, i.e. in /lib/rack/cache/context.rb:48.
def call(env)
if env['rack.run_once']
call! env
else
clone.call! env
end
end
As per rack specs (http://rack.rubyforge.org/doc/files/SPEC.html), rack.run_once is not a guaranty that the application will be served only once. The specs also describe rack.multithread if the application object may be simultaneously invoked by another thread in the same process. I'll send a pull request to add test that rack.multithread is not set to true i.e.
def call(env)
if env['rack.run_once'] && !env['rack.multithread']
call! env
else
clone.call! env
end
end
The text was updated successfully, but these errors were encountered:
When using puma with Rack::Cache, the assets do not get loaded correctly, this issue is described on the puma project: puma/puma#57
I found out that puma sets env['rack.run_once'] to true and rack-cache uses this information to determine to run the request on a non threadsafe mode, i.e. in /lib/rack/cache/context.rb:48.
As per rack specs (http://rack.rubyforge.org/doc/files/SPEC.html), rack.run_once is not a guaranty that the application will be served only once. The specs also describe rack.multithread if the application object may be simultaneously invoked by another thread in the same process. I'll send a pull request to add test that rack.multithread is not set to true i.e.
The text was updated successfully, but these errors were encountered: