michaeljmarshall opened a new pull request, #16553:
URL: https://github.com/apache/lucene/pull/16553

   ### Description
   
   `startStoredFields` is called unconditionally before the try block in 
`processDocument` and `processRowColumns`. If `fields[i].finish()` throws (e.g. 
a `Similarity` whose `computeNorm` returns 0 for a non-empty field), 
`finishStoredFields` was skipped, leaving the codec writer with an unmatched 
`startDocument`. At flush, `writer.finish(maxDoc)` sees fewer completed docs 
than expected and throws `"Wrote N docs, finish called with numDocs=M"`.
   
   Fixed by wrapping the finish loop in a `try/finally` that guarantees 
`finishStoredFields` runs. Same fix applied to both `processDocument` and 
`processRowColumns`.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to