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

[FIX] JamesMailSpooler should be more resilient on JVM Error #2159

Merged
Changes from 1 commit
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 @@ -138,14 +138,14 @@ private void performProcessMail(MailQueueItem queueItem, Mail mail) {
throw new InterruptedException("Thread has been interrupted");
}
queueItem.done(MailQueueItem.CompletionStatus.SUCCESS);
} catch (Exception e) {
} catch (Throwable e) {
handleError(queueItem, mail, originalRecipients, e);
} finally {
LOGGER.debug("==== End processing mail {} ====", mail.getName());
}
}

private void handleError(MailQueueItem queueItem, Mail mail, ImmutableList<MailAddress> originalRecipients, Exception processingException) {
private void handleError(MailQueueItem queueItem, Mail mail, ImmutableList<MailAddress> originalRecipients, Throwable processingException) {
int failureCount = computeFailureCount(mail);

// Restore original recipients
Expand Down Expand Up @@ -184,7 +184,7 @@ private void storeInErrorRepository(MailQueueItem queueItem) throws MessagingExc
queueItem.done(MailQueueItem.CompletionStatus.SUCCESS);
}

private void nack(MailQueueItem queueItem, Exception processingException) {
private void nack(MailQueueItem queueItem, Throwable processingException) {
try {
queueItem.done(MailQueueItem.CompletionStatus.REJECT);
} catch (MailQueue.MailQueueException ex) {
Expand Down