hang4309 opened a new pull request, #878: URL: https://github.com/apache/commons-io/pull/878
Follows up on [the reported failed reopen during rotation](https://www.mail-archive.com/[email protected]/msg78091.html). If opening the replacement throws `FileNotFoundException`, the existing try-with-resources closes the old reader. Subsequent reads may then terminate the tailer. Keeping that reader open alone is insufficient when the replacement grows past the previous position before the next poll. This patch opens the replacement before closing the old reader and retains `rotationPending` until reopening succeeds. Remaining old-file lines are read after the replacement opens. It does not fix the separate periodic `reOpen` failure path described in IO-399. Validation on base `f720b24227eb6972d4281d330ddb64c1416f81a4`: - Four deterministic rotation cases cover zero, one, and two failed opens, plus stopping during retry. Three fail on the unmodified base; all four pass with the patch. - Targeted Tailer run: 32 tests, zero failures/errors, one existing Windows skip. - Checkstyle, PMD, and SpotBugs checks pass. - The full default build did not complete successfully on Windows. Three `PathUtilsCopyTest` symlink privilege errors reproduce on the unmodified base. This is not a claim that the full test suite passes. Submitted following [the maintainer's suggestion to provide a PR with a failing test](https://www.mail-archive.com/[email protected]/msg78092.html). A Jira association can be added as needed. -- 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]
