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
Lazily initialize Environment in GenericFilterBean (aligned with HttpServletBean) [SPR-15469] #20029
Comments
Juergen Hoeller commented I'm rather surprised that you're watching the debug-level log so closely but you nevertheless got a point :-) Are you defining those filter beans within a Spring application context or in |
Caleb Cushing commented
well... I replaced our reliance on
looks like we're defining them as I also got to thinking that maybe the bean constructor/init could/should also log itself so that the log would look more like
in this way the logs would come after a log that tells you what's creating them. |
Juergen Hoeller commented When running in a Spring application context, |
Caleb Cushing commented ah, ok, I thought that was true, but then second guessed myself. Cool. |
Caleb Cushing commented #1405 basic implementation based on 4.3 branch not sure if |
Juergen Hoeller commented
Your PR generally goes in the right direction but I'm afraid we'll have to start with the master branch towards 5.0. I'll backport it to 4.3.x from there, possibly in a limited fashion. Being at it, I can also take care of the actual changes in master for 5.0 RC1; I'd also like to review all other |
Juergen Hoeller commented I've done a somewhat larger revision in the meantime, also addressing the |
Caleb Cushing opened SPR-15469 and commented
We noticed there were a lot of these logs
Stephane Nichol told me in a gitter conversation that this shouldn't happen.
I've finally had time to dig into this, to see why it's happening in our system. Turns out it's because of line 94 in
GenericFilterBean
every time we create a new filter we create a newStandardServletEnvironment
.So this leave's me with 2 questions on improvements.
GenericFilterBean
(normally I'd be against this, but not sure if most of the time, whether the global environment is auto passed or not)not sure fixing this is a major win for me, but it was confusing, and required using the debugger to navigate the stack to figure out why this was happening.
Affects: 4.3.8
Referenced from: commits dab56db, 1ea54eb
The text was updated successfully, but these errors were encountered: