[ https://issues.apache.org/jira/browse/JAMES-3059?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17044069#comment-17044069 ]
Benoit Tellier commented on JAMES-3059: --------------------------------------- https://github.com/linagora/james-project/pull/3134 contributed instrumentation at the session level for fault injection and synchronisation primitives allowing fault testing and concurrent testing to be done without mocks. 'defers' are no longer needed. Some work regarding API rafinement is still needed. Furthermore, https://github.com/linagora/james-project/pull/3119 is merged > Retry on step 2 (if fail) of mailbox creation > --------------------------------------------- > > Key: JAMES-3059 > URL: https://issues.apache.org/jira/browse/JAMES-3059 > Project: James Server > Issue Type: Improvement > Components: mailbox > Reporter: René Cordier > Priority: Major > > Mailbox creation method in `CassandraMailboxMapper`: > {code:java} > 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; > } > {code} > 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` -- This message was sent by Atlassian Jira (v8.3.4#803005) --------------------------------------------------------------------- To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org