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

Mail loss due to RabbitMQ ack failure

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • master, 3.8.0, 3.7.4
    • None
    • Queue, rabbitmq
    • None

    Description

      When RabbitMQ is busy or has other problems during mail spooling, it will fail to acknowledge the attempt to publish the mail reference, see Enqueuer.publishReferenceToRabbit(). The Enqueuer will detect this and clean up the mail queue view, to remove the mail from blob storage, see Enqueuer.cleanupMailQueueView(). However, this uses .thenReturn(Mono.<Void>error(e)), i.e. a success  Mono<Mono<Exception>>, which gets ignored afterwards. Consequently Enqueuer.enQueue() returns as a success as well, so the SendMailHandler reports the mail as "successfully spooled" to the sender while in reality it has already deleted it. The mail is lost.

      The fix is to change Enqueuer.cleanupMailQueueView() to use .then(Mono.<Void>error(e)), i.e. a failure Mono<Exception>, which propagates the exception up the chain and makes Enqueuer.enQueue() throw. The SendMailHandler will report "error processing message" to the sender so it can retry later.

      Attachments

        Activity

          People

            Unassigned Unassigned
            kotto Karsten Otto
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 1h 50m
                1h 50m