Issue #8000 : Route unreadable XML files to error handling - #8029
Merged
hansva merged 2 commits intoAug 21, 2026
Conversation
Get data from XML aborted the whole pipeline when a file could not be parsed. openNextFile() caught the failure, called stopAll() and setErrors(1) unconditionally, without ever asking whether the transform has an error hop -- so an invalid document killed the pipeline instead of being diverted, while the same document read from a field was handled correctly. When error handling is enabled, send the file to the error stream and carry on with the next one, matching what processPutRow already does for the in-fields path. The file pointer is normally advanced before the document is parsed, but a failure raised earlier -- resolving the file, reading its size or attributes -- leaves it untouched, so step over the file explicitly in that case rather than retrying it forever. openNextFile() now declares HopTransformException because putError() throws it; every caller already propagates HopException. Adds a file-based counterpart to testErrorHandlingContinuesOnBadXml: a good file, an unparseable one and another good file. Both good files are still read and the bad one produces a single error row. Reverting the change fails the test with one reported error, which is the behaviour in the report.
mattcasters
approved these changes
Aug 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses #8000.
The "Get data from XML" transform aborts the pipeline when a file cannot be parsed, instead of
routing the failure to the transform connected to its error hop. Reading the same document from a
field, or reading the file name from a field, behaves correctly — which is what makes the file path
look like an oversight rather than a design choice.
Cause
openNextFile()catches the parse failure and then unconditionally does this:It never asks whether the transform has error handling configured, so
stopAll()takes the wholepipeline down. That produces the "Pipeline is killing the other transforms!" line in the report. The
in-fields path does ask —
processPutRowchecksgetTransformMeta().isDoingErrorHandling()andcalls
putError— which is exactly why the two paths behave differently.Change
When error handling is enabled, the file is sent to the error stream and reading continues with the
next file. When it is not, the previous behaviour is untouched.
One wrinkle worth flagging for review.
data.filenris normally incremented before the document isparsed, so recursing into
openNextFile()moves on to the next file. But a failure raised earlier— resolving the file, reading its size, its attributes — leaves the pointer untouched, and recursing
would retry the same file forever. The change records the pointer on entry and steps over the file
explicitly if it has not advanced.
openNextFile()now declaresHopTransformException, becauseputErrorthrows it. Every calleralready propagates
HopException, so this does not ripple.Tests
testErrorHandlingContinuesOnBadXmlFileis the file-based counterpart to the existingtestErrorHandlingContinuesOnBadXml: a temporary folder holding a good file, an unparseable one andanother good file, with an error hop attached.
Reverting the production change fails that test with
transform should not report errors ==> expected: <0> but was: <1>, which is the behaviour described in the issue.Verification
mvn -pl plugins/transforms/xml -Pskip-uitest test— 154 tests, 0 failures, 0 errorsmvn spotless:checkandmvn apache-rat:checkpass on the module