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
Extending CachingConfigurerSupport results in at least one log message about not being eligible for full post-processing #27751
Comments
This should probably require a bit more investigation but I believe this might need to move to Spring Boot. An application that doesn't use the auto-configuration doesn't exhibit this issue, something like: @Configuration
public class CacheContext {
public static void main(String[] args) {
new AnnotationConfigApplicationContext(CacheContext.class);
}
@Bean
CacheManager cacheManager() {
return new SimpleCacheManager();
}
@Configuration
@EnableCaching
static class Caching extends CachingConfigurerSupport {
}
}
|
@snicoll You need a BPP to trigger the problem. This'll do it without Boot: package com.example.demo;
import org.springframework.beans.factory.config.BeanPostProcessor;
import org.springframework.cache.CacheManager;
import org.springframework.cache.annotation.CachingConfigurerSupport;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.cache.support.SimpleCacheManager;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class CacheContext {
public static void main(String[] args) {
new AnnotationConfigApplicationContext(CacheContext.class);
}
@Bean
static BeanPostProcessor someBeanPostProcessor() {
return new BeanPostProcessor() {
};
}
@Bean
CacheManager cacheManager() {
return new SimpleCacheManager();
}
@Configuration
@EnableCaching
static class CachingConfig extends CachingConfigurerSupport {
}
}
|
Sorry, 🤦 |
Not at all. I only know that because I made the same mistake earlier. I should have shared what I had learned when I opened the issue. |
sorry to bother, is there any news on this? currently we are blocked from upgrading since some of our monitoring relies on metrics now gone due to this issue |
@ThanksForAllTheFish no problem. I haven't got the time to look at it but I don't understand why that is blocking you from upgrading based on this specific issue in the core framework. Spring Boot 2.5 and Spring Boot 2.6 uses the same spring framework version so something else must have changed to trigger the error. @wilkinsona also provided a number of hints to fix the problem without having to wait for a fix here, see spring-projects/spring-boot#28840 (comment) |
@snicoll thanks for your feedback. I did not fully understand the issue and managed to fix the configuration on our side (replacing bean post processor) |
|
about metrics: This was exactly my initial problem: transactionManager is resolved, therefore mongoTransactionManager, therefore mongoMetricsAutoconfiguration (forgot the proper name), therefore influxMeterRegistry. influxMeterRegistry will not be configured by bean post processor, especially MeterRegistryPostProcessor.postProcessAfterInitialization is not executed for influxMeterRegistry. This results in an influxMeterRegistry where all metrics miss self declared tags that normally would have been configured via MeterRegistryCustomizer beans. |
Affects: 5.3.x
This was originally reported in a Spring Boot issue. While diagnosing the problem, I observed that even when a
CachingConfigurerSupport
has no dependencies, a log message about being ineligible for full post-processing is still logged. I discussed this with @snicoll and he asked me to raise an issue.This minimal Boot app can be used to reproduce the problem:
Note the third INFO message:
The text was updated successfully, but these errors were encountered: