linagora / james-project

Mirror of Apache James Project
Apache License 2.0
70 stars 63 forks source link

Deleted message vault: large deletes might take long #5094

Closed chibenwa closed 5 months ago

chibenwa commented 6 months ago

If I delete a mailbox with say 100.000 items copying it into the deleted message vault might take time.

More time than what is expected to run on the event bus. (10 minutes)

This leads to timeout.

Reproduction: delete a very large mailbox with MANYYY mails.

How to fix: good question.... IMO running verrryyyyy long things on the event bus might not seem desirable so increasing the timeout might not be that clever.

We COULD fire MessageDeleted events to a dedicated work queue: the callback would only read the cassandra projection and emit the headerId and blobId + necessary metadata so that another compent asynchronously do the copy? This async mode could only work with dedup on though. Might be the best idea.

THoughts?

chibenwa commented 6 months ago

What I currently have in my head:

dtm drawio (1)

chibenwa commented 5 months ago

CF https://github.com/apache/james-project/pull/2131