Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Refactor dev mode to call ApplicationProvider.get only once per request #7650

@richdougherty

Description

@richdougherty

We should only call ApplicationProvider.get at most once per request—ideally only once per reload. Calling it more often can lead to weird things like having the Application change in the middle of a single request. It can also lead to deadlock, e.g. #5975, #7614, #7622.

At the moment we don't have any serious bugs caused by calling Application.get multiple times per request but this is something we could look at refactoring.

Ideas for a fix: change AkkaHttpServer so that whenever the Application changes it makes a new AkkaHttpRequestHandler object. This object stores the Application object and stores derived classes like AkkaModelConversion and ForwardedHeaderHandler. This is a little bit harder than it sounds because the logic around getting an Application

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