Skip to content
Snippets Groups Projects
  1. May 14, 2020
  2. May 13, 2020
  3. May 12, 2020
  4. May 05, 2020
  5. May 04, 2020
  6. Apr 30, 2020
  7. Apr 28, 2020
    • Christoph Wurst's avatar
      Fix endless initial sync due to empty partial page · 6bdb866c
      Christoph Wurst authored
      
      The initial message cache sync estimates the UID range of the next
      message page so it can fetch messages efficiently. There was an
      uncovered edge case where the next page might not return any message,
      simple because there is a larger gap between the existing UIDs.
      Therefore the sync process was aborted as incomplete over and over as it
      could not make any progress and the number of known messages never
      reached the total number of messages on IMAP. This patch changes the
      logic so it retries the next page if the current one is empty. To break
      a possibly infinite recursion there is a check about reaching the
      highest UID reported by the server.
      
      Signed-off-by: default avatarChristoph Wurst <christoph@winzerhof-wurst.at>
      Unverified
      6bdb866c
  8. Apr 27, 2020
  9. Apr 24, 2020
  10. Apr 23, 2020
  11. Apr 21, 2020
  12. Apr 20, 2020
  13. Apr 16, 2020
  14. Apr 14, 2020
  15. Apr 07, 2020
    • Christoph Wurst's avatar
      Lower the memory footprint of the initial message cache sync · 72a5703e
      Christoph Wurst authored
      
      The initial message sync has to fetch potentially large amounts of data
      and insert that into the database. To work around limitations with sync
      requests triggered by web requests the process had already been made
      interruptable and resumable. This means we never insert all the data
      right away. Yet, the IMAP code fetched all UIDs before we capped it to a
      maximum number of results per sync attempt. Depending on the mailbox
      size this operation could require and allocate a lot of memory. On some
      setup with lower memory limits, the process was aborted by the web
      server due to a php memory exhaustion.
      
      This patch modifies the IMAP code to optimize the memory usage by
      limiting the amount of data that is fetched with each initial sync
      attempt. The algorithm works as follows.
      
      IMAP allows us to search in a range with a lower an upper bound UID.
      While we know the highest known UID from the current cache values, we
      can't derive the range for the next page from that as UIDs are not
      continuous but might have holes due to deleted messages. If we assume
      that messages of a mailbox are roughly distributed equally across the
      assigned UIDs we can guess the max UID for the next range.
      So we ask the server for min and max UIDs. The min or our known highest
      UID is always the lower bound. Then we can calculate the distribution
      rate from the min, max and number of messages and build the upper bound.
      On everage this will fetch about the expected number of messages. It
      could be more, but it could also be less. It shouldn't matter in most
      cases.
      
      Signed-off-by: default avatarChristoph Wurst <christoph@winzerhof-wurst.at>
      Unverified
      72a5703e
    • Christoph Wurst's avatar
  16. Apr 03, 2020
  17. Apr 01, 2020
  18. Mar 26, 2020
  19. Mar 25, 2020
  20. Mar 24, 2020
  21. Mar 23, 2020
  22. Mar 20, 2020
Loading