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

Update semaphore limit if connectionsPerHost or threadsAllowedToBlockForConnectionMultiplier changed after construction

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Done
    • Icon: Minor - P4 Minor - P4
    • None
    • 2.7.3
    • Connection Management
    • None

    Description

      User reports writing:

      Mongo mongo = new Mongo("127.0.0.1", 27017);
      mongo.getMongoOptions().connectionsPerHost = 100;
      mongo.getMongoOptions().threadsAllowedToBlockForConnectionMultiplier = 5;

      ... and then spinning up 100 threads, getting "out of semaphores" error. If options are set before constructing the Mongo instance, semaphore limit is large, as expected. Semaphore limit should be updated after construction if connectionsPerHost or threadsAllowedToBlockForConnectionMultiplier changes.

      Attachments

        Activity

          People

            Unassigned Unassigned
            jesse@mongodb.com A. Jesse Jiryu Davis
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: