Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move blocking readPair call to boundedElastic thread #1653

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,16 @@ public Mono<MailboxCounters> getMailboxCountersReactive(Mailbox mailbox) {
}
return Mono.just(counters);
})
.doOnNext(counters -> readRepair(mailbox, counters));
.doOnNext(counters -> {
if (this.cassandraConfiguration.getMailboxReadRepair() > 0) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm oretty sure it should be

Suggested change
if (this.cassandraConfiguration.getMailboxReadRepair() > 0) {
if (this.cassandraConfiguration.getMailboxCountersReadRepair() > 0) {

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, you mean we should update the name in the original configuration file too? 🤔
Screen Shot 2023-07-25 at 12 13 15 AM

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe what chibenwa is saying is:

  • getMailboxReadRepair() is used in CassandraMailboxMapper
  • for CassandraMessageMapper , we use getMailboxCountersReadRepairChanceMax() and/or getMailboxCountersReadRepairChanceOneHundred()

=> for example: https://github.com/apache/james-project/blob/master/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/mail/CassandraMessageMapper.java#L197

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we could extract that line actually in a function to avoid duplication, that we could call from there and from your code change :)

Mono.fromRunnable(() -> {
readRepair(mailbox, counters);
})
.subscribeOn(Schedulers.boundedElastic())
.subscribe();
}
});

}

public Mono<MailboxCounters> readMailboxCounters(CassandraId mailboxId) {
Expand Down