Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-2561

Allow for limited threadpool size in the Async driver

    XMLWordPrintableJSON

Details

    • Icon: New Feature New Feature
    • Resolution: Fixed
    • Icon: Major - P3 Major - P3
    • 3.6.0
    • None
    • Async
    • None
    • Using MongoDB Reactive Streams driver 1.5

    Description

      Allow users to provide to limit the thread pool size or to supply an own ExecutorService.

      Was:

      Unlimited thread pool growth using AsynchronousSocketChannel

      Mongo Driver async uses AsynchronousSocketChannel without channel grouping that leads to the creation of an unbounded default thread pool. The pool grows with concurrent connection use, and it's not possible to limit the thread pool size or to supply an own ExecutorService.

      This arrangement can allocate a lot of resources which is not desirable in the particular scenario of nonblocking usage. It's not possible to limit resources or a strategy for back-pressure caused by higher workload than available resources (reject, queue, allocate resources). Supplying an ExecutorService via AsynchronousSocketChannelStreamFactoryFactory could help to address the issue.

      The issue originated in MongoDB RS driver usage, hence I'm filing the ticket here and not in the JAVA (async) driver project.

      Attachments

        Activity

          People

            ross@mongodb.com Ross Lawley
            mp911de Mark Paluch
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: