-
Notifications
You must be signed in to change notification settings - Fork 40.5k
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
Background preinitialisation may cause Jackson2ObjectMapperBuilder's Kotlin detection warning to be silently dropped #21897
Comments
Can you provide a bit more information, I'm not that familiar with that part of the code? What's the warning message that you see when |
Also reproduced in 2.3.1. Here should be a warning: Here is the property that you can toggle to see it: Just checked, 2.1.14 emits this warning regardless of whether this property was set or not. |
Thanks for the extra info. |
2.2 logs the expected warning:
|
There's a race condition between logging performed during background pre-initialization and LogbackLoggingSystem removing its deny-all turbo filter. In 2.2, removing the filter wins but in 2.3 it does not. This change is due to 2.3 not having Hibernate Validator on the classpath. Adding a dependency on |
Adding the deny-all filter and starting background preinitialisation are both triggered by |
The specific pre-initialization of Jackson is pointless in most cases as it will have already been initialised via
An alternative is to move background preinitialization from application starting to environment prepared. This improves the situation but is still slower:
Sticking with environment prepared and removing the duplicate initialisation of Jackson makes no noticeable difference. Splitting the preinitialization so that message converter initialisation is done in environment prepared and everything else is done in application starting possibly closes the gap a little but it's still slower than before:
|
We'd like to try configuring the builder with an empty list of modules. That will prevent it from configuring well-known modules so it won't trigger the single-time warning about Kotlin. |
The builder with an empty list of modules does not help as the message converter initialiser, via creation of an |
Hi,
I'm not sure when it started to happen, maybe even before 2.3.0, but it's easily reproduced with a minimal
spring-boot-starter-web
app and can be fixed by disablingBackgroundPreinitializer
.Could you check it please? Many thanks.
The text was updated successfully, but these errors were encountered: