Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid BlockHound NoSuchTypeException when context propagation depende…
…ncy is unavailable (#3337) When the context-propagation jar is unavailable (which can happen since the dependency is optional), then BlockHound reports the following ERROR log: reactor.blockhound.shaded.net.bytebuddy.pool.TypePool$Resolution$NoSuchTypeException: Cannot resolve type description for io.micrometer.context.ContextRegistry This log does not break anything, it is only about logging, but it can be avoided using this patch. In a nutshell, Byte Buddy requires all type information for a transformed type to be available, else the above error log may be displayed. The log may happen occasionally with very rare byte code combinations when the class is being defined (initial classloading). To avoid this problem, the proposed patch is refactoring the ContextPropagation static initializer in order to not use a lambda when capturing the context snapshot.
- Loading branch information