Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(inputs.tail): Prevent deadlock when closing and max undelivered lines hit #15649

Merged
merged 1 commit into from
Jul 24, 2024

Conversation

powersj
Copy link
Contributor

@powersj powersj commented Jul 22, 2024

Summary

When we try to close the tailer, tail will block until the goroutine is in a dead state. When a tailer had read more than the max undelivered this condition was never hit and we deadlocked. This ensures that when the tailer is trying to die we clear out the channel to close successfully.

This was not an issue when the max undelivered was not hit.

Checklist

  • No AI generated code was used in this PR

Related issues

fixes: #15641

@telegraf-tiger telegraf-tiger bot added area/tail fix pr to fix corresponding bug plugin/input 1. Request for new input plugins 2. Issues/PRs that are related to input plugins labels Jul 22, 2024
@powersj powersj self-assigned this Jul 22, 2024
@powersj powersj added the ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review. label Jul 23, 2024
@powersj powersj marked this pull request as ready for review July 23, 2024 12:42
@powersj powersj assigned srebhan, dgnorton and DStrand1 and unassigned powersj and dgnorton Jul 23, 2024
@DStrand1 DStrand1 removed their assignment Jul 23, 2024
@srebhan srebhan merged commit 6874f41 into influxdata:master Jul 24, 2024
27 checks passed
@github-actions github-actions bot added this to the v1.31.3 milestone Jul 24, 2024
powersj added a commit that referenced this pull request Aug 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/tail fix pr to fix corresponding bug plugin/input 1. Request for new input plugins 2. Issues/PRs that are related to input plugins ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tail plugin prevents Telegraf from exiting
4 participants