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

Retry on step 2 (if fail) of mailbox creation

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 3.5.0
    • Component/s: mailbox
    • Labels:
      None

      Description

      Mailbox creation method in `CassandraMailboxMapper`:

          private boolean trySave(Mailbox cassandraMailbox, CassandraId cassandraId) {
              boolean isCreated = mailboxPathV2DAO.save(cassandraMailbox.generateAssociatedPath(), cassandraId).block();
              if (isCreated) {
                  Optional<Mailbox> simpleMailbox = retrieveMailbox(cassandraId).blockOptional();
                  simpleMailbox.ifPresent(mbx -> mailboxPathV2DAO.delete(mbx.generateAssociatedPath()).block());
                  mailboxDAO.save(cassandraMailbox).block();
              }
              return isCreated;
          }
      

      Shortly:

      1. Persisting a mailboxPath
      2. Persisting a mailbox.

      There's should be a case: after step 1 finishes, step 2 fails, it leads to the mailboxPath & mailbox inconsistent. To avoid this, you can perform retry on the step 2 to reduce the chance producing inconsistent.

      DOD: update the code, write unit tests to prove it `reduce the chance producing inconsistent`

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              rcordier René Cordier
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: