Fix Blockhound config for micrometer-context-propagation

Since the ServiceLoader reads the files in a blocking way, Blockhound can detect these and cause java.lang.NoClassDefFoundError: Could not initialize class errors if the ServiceLoader is called from a static scope (static variable init or static block).
This commit is contained in:
Jonatan Ivanov
2022-07-18 16:47:33 -07:00
parent 64f13b875c
commit c28e7e027e

View File

@@ -93,9 +93,9 @@ public class CustomBlockHoundIntegration implements BlockHoundIntegration {
"org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader", "loadBeanDefinitions");
builder.allowBlockingCallsInside("org.springframework.core.type.classreading.SimpleMetadataReader",
"getClassReader");
builder.allowBlockingCallsInside("io.micrometer.contextpropagation.ThreadLocalAccessorLoader",
"getThreadLocalAccessors");
builder.allowBlockingCallsInside("io.micrometer.contextpropagation.PropagatorLoader", "getPropagatorForSet");
builder.allowBlockingCallsInside("io.micrometer.context.ContextRegistry", "loadContextAccessors");
builder.allowBlockingCallsInside("io.micrometer.context.ContextRegistry", "loadThreadLocalAccessors");
}
}