Uploaded image for project: 'James Server'
  1. James Server
  2. JAMES-3204

CassandraMessageMapper badly applies LIMIT

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 3.5.0
    • Fix Version/s: 3.6.0
    • Component/s: cassandra, mailbox
    • Labels:
      None

      Description

      We noticed some `BusyPool` exceptions filling up the driver queue upon IMAP query (FETCH flags for all the messages in the mailbox).

      The MessageManager do batch those reads (by default by 200 for metadata)., wich then call the MessageMapper with this limit.

      Some unit tests performed at the Cassandra mailbox level proved the soft filtering did badly applies, and that we were performing uneeded extra reads for the full batch read from the database.

      One good mitigation strategy is to push the limit to the Cassandra query, and ensures filtering happens before the extra reads are performed.

      https://projectreactor.io/docs/core/release/api/reactor/core/publisher/Flux.html#take-long- documents that it just don't propagate downstream request once a given amount is reached however it do not ensure any form of backpressure. We might want to further audit our code, looking for similar take mis-usages.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              btellier Benoit Tellier
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: