-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Description
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