-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Avoid multiple calls to ApplicationProvider#get for a single request #8166
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Also fixes #7650 - thanks! I can review this tomorrow if you like. |
|
👍 A review would be great. I'm not totally happy with the way the code is structured now so I wonder if you have ideas on how to do it more elegantly. |
richdougherty
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - I have lots of ideas for changing how the whole request pipeline works (see #8005), but this looks like a good incremental step.
richdougherty
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Meant to approve in last review)
|
Regarding the comment above:
I guess we can close #7650 now. |
As far as I can tell,
ApplicationProvider#getis not meant to be called multiple times for the same request. It looks like that was the case previously, but in 2.6.x we've added some caching based on theTry[Application]instance and are calling theApplicationProviderto get the current instance each time. The current dev mode reload logic forces a reload next time (forceReloadNextTime = true) when compilation fails, so ifgetis called more than once for a single request, that causes multiple compilations per request.My solution here proposes to get the
Try[Application]once and pass that instance around for the handling of the request.Fixes #7753