Skip to content

Log reprocess failures instead of dropping them silently (fixes #615) - #618

Open
iacsha wants to merge 1 commit into
OpenIntegrationEngine:mainfrom
iacsha:fix/615-reprocess-errors
Open

iacsha wants to merge 1 commit into
OpenIntegrationEngine:mainfrom
iacsha:fix/615-reprocess-errors

Conversation

@iacsha

@iacsha iacsha commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

Fixes #615.

DonkeyMessageController.reprocessMessages dropped two kinds of failure while dispatching a message:

  • a ChannelException that doesn't stop the channel was caught and ignored, and
  • any other Throwable was dropped with the comment "An error should have been logged", which isn't true for a failure the dispatch path doesn't already handle.

Reprocessing runs on its own thread after the request has returned, so the server log is the only place a failure can show up.

Change

  • Both cases now go through a small logReprocessFailure helper: the message is logged with its channel and message id, and the job moves on to the next message. A channel that is stopping still cancels the job, with the same log line as before.
  • MessageServlet's reprocess thread also logs anything other than a ControllerException. A runtime exception from the steps before dispatch (decrypting, re-attaching attachments) previously ended that thread with nothing in the server log.

I left the existing behaviour of Channel.dispatchRawMessage wrapping a RuntimeException as a "stopped" ChannelException alone; that one is logged already, just with the "job cancelled" wording, and changing it is a wider decision.

Testing

  • New DonkeyMessageControllerReprocessTest (3 tests: non-stopping ChannelException, unexpected RuntimeException, stopping channel). :server:test passes.
  • Reproduced the issue on a server built from main with an unconditional throw added to DonkeyEngineController.dispatchRawMessage for reprocessed messages only (not part of this PR): deploy ci/tests/101-raw-no-op, send one message, reprocess it. The reprocess returns 204 and the server log has nothing about it.
  • Same steps on this branch (with the same temporary throw): the log shows
ERROR ... [Message Reprocess Thread < MessageServlet Thread (Reprocess messages) < ...] com.mirth.connect.server.controllers.DonkeyMessageController: Could not reprocess message 1 for channel 62af393b-ff61-47ec-b5fa-ccd2cd08ce55.
java.lang.IllegalStateException: Synthetic dispatch failure for the #615 repro

…ntegrationEngine#615)

DonkeyMessageController.reprocessMessages swallowed two kinds of failure while
dispatching a message: a ChannelException that does not stop the channel was
caught and ignored, and any other Throwable was dropped on the assumption that
it had already been logged. Reprocessing runs on its own thread after the
request returns, so the server log is the only place a failure can show up.

Each failed message is now logged with its channel and message id and the job
moves on to the next message; a channel that is stopping still cancels the job
as before. MessageServlet's reprocess thread also logs anything other than a
ControllerException, which previously ended the thread with nothing logged.

Signed-off-by: iacsha <122627209+iacsha@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Error during reprocess silently fails

1 participant