Skip to content

jackson blocking calls reported by BlockHound #33474

@krysiuda

Description

@krysiuda

Hi,

We have a webflux/reactor application running in production, after recent JVM upgrade we've noticed new exceptions thrown by BlockHound, for a blocking call in com.fasterxml.jackson.databind.deser.DeserializerCache (part of jackson-databind).

While taking a look at the jackson implementation I notice:

    /**
     * We hold an explicit lock while creating deserializers to avoid creating duplicates.
     * Guards {@link #_incompleteDeserializers}.
     *
     * @since 2.17
     */
    private final ReentrantLock _incompleteDeserializersLock = new ReentrantLock();

so some of the initialization will definitely block on the ReentrantLock.

The dependency tree leading to jackson-databind starts from:
spring-boot-starter-data-elasticsearch->spring-data-elasticsearch->jackson-databind
AND:
spring-boot-starter-webflux->spring-boot-starter-json->jackson-databind
it's a transient dependency, we don't require it directly.

I believe since jackson-databind uses a ReentrantLock, an whitelist exception should be added for BlockHound, and since jackson-databind is required for spring-boot-starter-webflux it seems reasonable to make it part of webflux starter.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions