[IO-460] Read newly appearing tailed files from the beginning - #880
Open
dlwhdgus0810 wants to merge 2 commits into
Open
dlwhdgus0810 wants to merge 2 commits into
dlwhdgus0810 wants to merge 2 commits into
Conversation
Only seek to EOF when the initial open succeeds. Preserve initial content after missing-file retries and cover both start modes with deterministic tests. Signed-off-by: Hyun Lee <dlwhdugs4147@gmail.com>
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.
[IO-460] Read newly appearing tailed files from the beginning
When Tailer starts with
tailFromEnd=trueand the file is initially missing, it currently seeks to EOF when a later open succeeds. This drops lines written while Tailer was waiting for the file.Apply the EOF starting position only when the initial open succeeds. After a missing-file open, start at offset zero. The configured start mode and rotation handling remain intact.
The regression runs Tailer synchronously with a real file-backed reader and controlled missing-file opens. Six cases cover zero, one, and two failed initial opens with both start modes. The two retry cases with
tailFromEnd=truefail on the unmodified source and pass with this change.Issue: https://issues.apache.org/jira/browse/IO-460
Validation (macOS aarch64, BellSoft JDK 21.0.7, Maven 3.9.14):
mvn -B -ntp -Dtest=TailerTest#testTailFromEndAfterInitialOpen test: baseline 6 tests, 2 expected failures; fixed source 6 tests, no failures or skips.mvn -B -ntp(repository default goals): BUILD SUCCESS; 6,622 tests, 0 failures, 0 errors, 33 skipped. Includes all 33 Tailer tests passing, covering existing-file start modes and rotation.The regression controls failed opens through
Tailableand uses a real file-backed reader; it does not depend on a filesystem creation race or sleeps. Validation was limited to this macOS/JDK environment; the full-suite skipped cases were not exercised.