Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-32062

Log a WARN when a queryAndFetch is performed against MongoDB with too many results

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 2021.0
    • Fix Version/s: 2021.x, 2023.x
    • Component/s: Core MongoDB

      Description

      MongoDBConnection#queryAndFetch iterates over all the documents which match the query to build the DBSQueryResult object.

      If the queryAndFetch method returns many documents, some developers have observed that it can lead to an OutOfMemoryError. Because of that, Nuxeo's recommendation is to use BAF instead of queryAndFetch when the database is MongoDB (no issue with VCS which uses an iterator).

      The same way that Nuxeo logs a message when a too big selection is done (Selection#warnIfBig with the default threshold = 15000), it would help the developers to have a warning when they use MongoDBConnection#queryAndFetch. The threshold has to be defined.

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: