Skip to content

[IO-460] Read newly appearing tailed files from the beginning - #880

Open
dlwhdgus0810 wants to merge 2 commits into
apache:masterfrom
dlwhdgus0810:fix-tailer-created-file
Open

dlwhdgus0810 wants to merge 2 commits into
apache:masterfrom
dlwhdgus0810:fix-tailer-created-file

Conversation

@dlwhdgus0810

Copy link
Copy Markdown

[IO-460] Read newly appearing tailed files from the beginning

When Tailer starts with tailFromEnd=true and 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=true fail 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.
  • Required RAT, japicmp, Checkstyle (0 violations), SpotBugs (0 bugs/errors), PMD and Javadoc goals passed.

The regression controls failed opens through Tailable and 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.

dlwhdgus0810 and others added 2 commits September 21, 2026 18:29
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>
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.

1 participant