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

MongoInterruptedException incorrectly thrown from server monitor thread and logged

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Minor - P4 Minor - P4
    • 4.8.1
    • Affects Version/s: 4.8.0
    • Component/s: Logging
    • None
    • Not Needed

      Summary

      Upgraded from 4.2.3 to 4.8.0 and this error is sometimes logged when we create the MongoClient:

      Exception in thread "cluster-ClusterId{value='<valueremovedforissue>', description='null'}-localhost:27017" com.mongodb.MongoInterruptedException: Interrupted waiting for lock
          at com.mongodb.internal.Locks.checkedWithLock(Locks.java:49)
          at com.mongodb.internal.Locks.withLock(Locks.java:36)
          at com.mongodb.internal.Locks.withLock(Locks.java:29)
          at com.mongodb.internal.connection.BaseCluster.withLock(BaseCluster.java:275)
          at com.mongodb.internal.connection.AbstractMultiServerCluster.withLock(AbstractMultiServerCluster.java:54)
          at com.mongodb.internal.connection.BaseCluster.updateDescription(BaseCluster.java:247)
          at com.mongodb.internal.connection.AbstractMultiServerCluster.updateDescription(AbstractMultiServerCluster.java:385)
          at com.mongodb.internal.connection.AbstractMultiServerCluster.lambda$onChange$3(AbstractMultiServerCluster.java:214)
          at com.mongodb.internal.Locks.lambda$withLock$0(Locks.java:30)
          at com.mongodb.internal.Locks.checkedWithLock(Locks.java:43)
          at com.mongodb.internal.Locks.withLock(Locks.java:36)
          at com.mongodb.internal.Locks.withLock(Locks.java:29)
          at com.mongodb.internal.connection.BaseCluster.withLock(BaseCluster.java:275)
          at com.mongodb.internal.connection.AbstractMultiServerCluster.withLock(AbstractMultiServerCluster.java:54)
          at com.mongodb.internal.connection.AbstractMultiServerCluster.onChange(AbstractMultiServerCluster.java:164)
          at com.mongodb.internal.connection.DefaultSdamServerDescriptionManager.updateDescription(DefaultSdamServerDescriptionManager.java:113)
          at com.mongodb.internal.connection.DefaultSdamServerDescriptionManager.lambda$update$0(DefaultSdamServerDescriptionManager.java:75)
          at com.mongodb.internal.Locks.lambda$withLock$0(Locks.java:30)
          at com.mongodb.internal.Locks.checkedWithLock(Locks.java:43)
          at com.mongodb.internal.Locks.withLock(Locks.java:36)
          at com.mongodb.internal.Locks.withLock(Locks.java:29)
          at com.mongodb.internal.connection.BaseCluster.withLock(BaseCluster.java:275)
          at com.mongodb.internal.connection.AbstractMultiServerCluster.withLock(AbstractMultiServerCluster.java:54)
          at com.mongodb.internal.connection.DefaultSdamServerDescriptionManager.update(DefaultSdamServerDescriptionManager.java:60)
          at com.mongodb.internal.connection.DefaultServerMonitor$ServerMonitorRunnable.run(DefaultServerMonitor.java:170)
          at java.lang.Thread.run(Thread.java:748)
      Caused by: java.lang.InterruptedException
          at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireInterruptibly(AbstractQueuedSynchronizer.java:1220)
          at java.util.concurrent.locks.ReentrantLock.lockInterruptibly(ReentrantLock.java:335)
          at com.mongodb.internal.Locks.checkedWithLock(Locks.java:41)
          ... 25 more
      

       
      Application work properly and all is fine except this exception on our startup (Playframework).

      If we switch back to previous version all is back to normal. We are looking to migrate our production cluster (Atlas) to version 6.x so our first step is to upgrade the Java Driver.

      URI : mongodb://localhost:27017,127.0.0.1:27018/?replicaSet=rs0

      Please provide the version of the driver. If applicable, please provide the MongoDB server version and topology (standalone, replica set, or sharded cluster).

      Impacted version : 4.8.0

      How to Reproduce

      Hard to tell

            Assignee:
            jeff.yemin@mongodb.com Jeffrey Yemin
            Reporter:
            maxence.warzecha@empirys.com Maxence Warzecha
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: