-
Notifications
You must be signed in to change notification settings - Fork 464
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
[FIX] JamesMailSpooler should be more resilient on JVM Error #2159
[FIX] JamesMailSpooler should be more resilient on JVM Error #2159
Conversation
Upon JVM Error, the error would not be caught to be retried. Therefore, the message would not be acked -> RabbitMQ would disconnect the MailQueue consumer after the Delivery Acknowledgement Timeout. For example, a custom mailet that depends on the old `javax` APIs caused `java.lang.NoSuchMethodError: 'javax.mail.internet.MimeMessage org.apache.mailet.Mail.getMessage()` that caused the RabbitMQ consumer being disconnected.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please have a test for this?
How is the test that you want? Write a unit test using a FYI there is no test setup for |
Can we skip test for this? |
You do not know me well, then... CF But only the memory implementation is exercised. Maybe minimal tests on top of the rabbitMQ mailQueue? |
There's a high value added for such a test to be honnest. I would however agree that it is done in a follow up PR. |
Ticket: linagora#5146 |
The error could be thrown upon an extension mailet relying on old James's API. Today James mailet pipeline is not resilient on that error, we should be more resilient on that. Add tests for 3 cases of `onMailetException`: - default: should trigger error processor - propagate: propagate error to `JamesMailSpooler` - ignore: error should be ignored
`onMailetException` has had no impact upon `NoSuchMethodError`.
I pushed the tests in this PR by the way. |
Upon JVM Error, the error would not be caught to be retried. Therefore, the message would not be acked -> RabbitMQ would disconnect the MailQueue consumer after the Delivery Acknowledgement Timeout.
For example, a custom mailet that depends on the old
javax
APIs causedjava.lang.NoSuchMethodError: 'javax.mail.internet.MimeMessage org.apache.mailet.Mail.getMessage()
that caused the RabbitMQ consumer being disconnected.And
NoSuchMethodError
is a subclass ofThrowable
, notException
.