Skip to content

Unable to acquire connection from pool within configured maximum time #2632

@RomanRomanenkov

Description

@RomanRomanenkov

Hi, I have a Reactive REST API using Spring Data Neo4j (SpringBoot v2.7.5).

I noticed lots of error logs in our service "org.neo4j.driver.exceptions.ClientException: Unable to acquire connection from the pool within configured maximum time of 60000ms". I use default configuration provided by SDN.

I was able to reproduce the error. If I return Mono.error in case of an empty result, all the connections from the pool are in use and the service cannot acquire a new connection, no matter how much time passes.

private fun findUserById(id: UUID): Mono<User> {
        return userRepository.findById(id)
            .switchIfEmpty(Mono.error(NotFoundException("User $id not found")))
    }

With enabled property log-leaked-sessions: true, there are "Neo4j Session object leaked, please ensure that your application fully consumes results in Sessions or explicitly calls close on Sessions before disposing of the objects." logs.

Only after restarting the service, it returns to a healthy state. Why are the connections from the pool not get getting closed?

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions