Hello

I use Mongo Reactive with Spring Boot 2 And I have sometimes this stacktrace :

    level
     Error
thread_name
     http-nio-8030-exec-307
logger_name
     org.apache.catalina.core.ContainerBase.[Tomcat].[localhost].[/].[dispatcherServlet]
env
    STAGING
message
    Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.dao.DataAccessResourceFailureException: Timeout waiting for a pooled item after 28486 MILLISECONDS; nested exception is com.mongodb.MongoTimeoutException: Timeout waiting for a pooled item after 28486 MILLISECONDS] with root cause

@timestamp 
    2018-03-20T10:14:55.581Z
stack_trace
    c.m.MongoTimeoutException: Timeout waiting for a pooled item after 28486 MILLISECONDS

    at c.m.i.c.ConcurrentPool.get(ConcurrentPool.java:141)

    at c.m.c.DefaultConnectionPool.getPooledConnection(DefaultConnectionPool.java:259)
    at c.m.c.DefaultConnectionPool.access$200(DefaultConnectionPool.java:60)
    at c.m.c.DefaultConnectionPool$1.run(DefaultConnectionPool.java:164)
    at j.u.c.Executors$RunnableAdapter.call(Executors.java:514)

    at j.u.c.FutureTask.run(FutureTask.java:264)

    at j.u.c.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
    at j.u.c.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)

    at java.lang.Thread.run(Thread.java:844)

Is it a bug ?

Comment From: wilkinsona

It's hard to say with just a stack trace but it looks like Mongo's pool has no connections available. Please ask a question on Stack Overflow providing a minimal, complete, and verifiable example. If it turns out to be a bug and it's a bug in Spring Boot, we can re-open this issue.

Comment From: mmaryo

Sorry I was not accurate @wilkinsona I think it's a bug

    return customerRepository.findAll()
            .doOnNext(contact -> {
                // block here
                Customer customer = customerRepository.findById("toto").block();
                //
            })
            .then(Mono.just("ok"));

The code is blocking when I run mongo request inside mongo request

I join a full test project with that code + a test

spring-boot2-mongo-reactive-app-bug.zip

Comment From: wilkinsona

@mmaryo Thanks. Unfortunately, I think that needs to be investigated by the Spring Data MongoDB team. Please open a JIRA ticket.

Comment From: mmaryo

it's ok, thanks

Comment From: pedroanhezini

alguma resposta?

Comment From: snicoll

My Portuguese is rusty @pedroanhezini but this is an issue with Spring Data MongoDB. Please follow-up there as Andy already indicated.