ExportXMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Unknown
    • 5.16.0
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • Fully Compatible
    • Java Drivers
    • Not Needed
    • None
    • None
    • None
    • None
    • None
    • None

      In driver-reactive-streams, the per-call maxTime option is silently ignored by:

      - MongoCollection.findOneAndUpdate (both overloads)
      - MongoCollection.findOneAndDelete
      - MongoCollection.findOneAndReplace
      - MongoCollection.createIndex and createIndexes 
      - MongoCollection.dropIndex 

      No maxTimeMS is added to the findAndModify, createIndexes or dropIndexes command.

       

      Might be the regression from this PR https://github.com/mongodb/mongo-java-driver/commit/01aff5a078#diff-bd1ac2c69bb6cd9ce09ef4f07c1628849e85411ee51c104c8c8b9271c9aa7b65https://github.com/mongodb/mongo-java-driver/commit/01aff5a078#diff-bd1ac2c69bb6cd9ce09ef4f07c1628849e85411ee51c104c8c8b9271c9aa7b65

       

      Looks like we should implement it the same way as countDocuments did

       

          Publisher<Long> countDocuments(@Nullable final ClientSession clientSession, final Bson filter, final CountOptions options) {
              return createReadOperationMono(
                      (operations -> operations.createTimeoutSettings(options)),
                      () -> operations.countDocuments(notNull("filter", filter), notNull("options", options)
              ), clientSession);
          }
       
      

      while the incorrect findOneAndDelete looks like this 

       

          Publisher<T> findOneAndDelete(@Nullable final ClientSession clientSession, final Bson filter, final FindOneAndDeleteOptions options) {
              return createWriteOperationMono(
                      operations::getTimeoutSettings,
                      () -> operations.findOneAndDelete(notNull("filter", filter), notNull("options", options)), clientSession);
          }

       

       

       

            Assignee:
            Almas Abdrazak
            Reporter:
            Almas Abdrazak
            Nabil Hachicha
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: