Skip to content

deps: bump go-tail to fix duplicates and stalls - #1350

Open
bigbes wants to merge 4 commits into
masterfrom
bigbes/tntp-3131-go-tail-bump
Open

deps: bump go-tail to fix duplicates and stalls#1350
bigbes wants to merge 4 commits into
masterfrom
bigbes/tntp-3131-go-tail-bump

Conversation

@bigbes

@bigbes bigbes commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

go-tail v1.4.14 could deliver a line twice right after a log rotation (a watch armed while the file was being replaced kept a stale size baseline, so the first write to the new file looked like a truncation and forced a reopen from offset zero; a watch kept across the reopen paths could be dead with a latched delete notification, forcing one more reopen) or stall the tailer forever after its watcher goroutine lost the shared events channel. This bumps go-tail to the fix and cleans up the tt-side follow plumbing. The pinned revision is the head of tarantool/go-tail#6; it will be switched to the v1.4.15 tag once the fix is released.

  • tail: fix follow fallback retry pacing and diagnostics
  • tail: yield only complete lines when following
  • deps: bump go-tail to fix rotation duplication and stalls
  • test: drop rotation settle delay in tcm log test
    • 20 consecutive runs of all 42 test_log_rotate parametrizations passed with the delay removed.

Part of TNTP-3131

bigbes added 4 commits August 7, 2026 07:43
Three small defects in the follow fallback plumbing:

* the "log file unavailable" message passed no argument for its %q
  verb and printed %!q(MISSING) instead of the file name (go vet does
  not catch it: apex/log is not recognized as a printf wrapper);
* tryReopenTailer slept retryOpenDelay before the first attempt even
  when the file was already back in place, and the timer.Stop deferred
  inside the loop piled up until the function returned — try first,
  wait only between attempts;
* a tailer that stopped without an error was reported through %w with
  a nil operand, producing "%!w(<nil>)" — report it as an unexpected
  termination instead.

Part of TNTP-3131
Both follow paths asked the tail library for incomplete lines. At EOF
the library then yields the half-written line it happened to catch and
seeks to the end of the file, which splits a log record in two and can
skip bytes appended between the read and the seek. Log records are
line-oriented, so buffer the half-written line until its newline
arrives instead.

Part of TNTP-3131
go-tail v1.4.14 could deliver a line twice right after a log rotation:
a watch armed while the file was being replaced kept a stale size
baseline, so the first write to the new file looked like a truncation
and forced a reopen from offset zero; a watch kept across the reopen
paths could also be dead with a latched delete notification, forcing
one more reopen. A watcher goroutine that lost its events channel
exited silently, corrupting the shared watch refcount and stalling the
tailer forever.

The pinned revision is the head of tarantool/go-tail#6; switch it to
the v1.4.15 tag once the fix is released.

Part of TNTP-3131
The 0.5 s pause between creating the replacement file and writing to
it was a crutch for the tailer losing a rotation that landed while its
watch was not armed. The tail library now rechecks the file after
arming the watch and re-arms it across reopens, so the rotation test
can exercise the tight timing again. 20 consecutive runs of all 42
test cases passed with the delay removed.

Part of TNTP-3131
@bigbes
bigbes force-pushed the bigbes/tntp-3131-go-tail-bump branch from e90e0bd to 9129fa8 Compare August 7, 2026 04:47
@bigbes bigbes changed the title deps: bump go-tail to fix rotation duplication and stalls deps: bump go-tail to fix duplicates and stalls Aug 7, 2026
@bigbes
bigbes requested a review from sssciel August 10, 2026 05:39
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.

2 participants