Skip to content

Middleware instantiated multiple times under JRuby #1102

Open
@mwpastore

Description

@mwpastore

Running a simple app on Puma under JRuby (in single mode with many threads), I've noticed that a single use statement in my Sinatra class definition causes that piece of middleware to be instantiated multiple times, instead of it being instantiated once and shared between threads (as one might suspect). Moving the use statement out of the class definition and into a rackup script solves the problem, as does calling run MyApp.new instead of run MyApp from the rackup script.

Sinatra 1.4.7, Puma 3.1.0, JRuby 9.0.5.0, OpenJDK 7.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions