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

docs(inputs.syslog): Document change of default read timeout to infinite #14828

Merged
merged 3 commits into from
Feb 26, 2024

Conversation

srebhan
Copy link
Member

@srebhan srebhan commented Feb 15, 2024

Summary

When setting a read-timeout on stream connections such as TCP, the server (in this case the syslog plugin) reads from an initiated connection. In case no new message arrives during the set period, the read times out and the plugin expects the connection to be dead. As a consequence, the connection is closed.

In case of syslog, this means that the remote logger needs to send logs with a maximum time-distance of the set timeout. By default we set a timeout of 5 seconds which forces the logger to send log every 5 seconds as otherwise the connection times-out and is closed. This causes errors such as

Feb  4 22:18:17 logserver rsyslogd: omfwd: remote server at 127.0.0.1:6514 seems to have closed connection. This often happens when the remote peer (or an interim system like a load balancer or firewall) shuts down or aborts a connection. Rsyslog will re-open the connection if configured to do so (we saw a generic IO Error, which usually goes along with that behaviour). [v8.2302.0 try https://www.rsyslog.com/e/2027 ]
Feb  4 22:18:17 logserver rsyslogd: action 'action-0-builtin:omfwd' suspended (module 'builtin:omfwd'), retry 0. There should be messages before this one giving the reason for suspension. [v8.2302.0 try https://www.rsyslog.com/e/2007 ]
Feb  4 22:18:17 logserver rsyslogd: action 'action-0-builtin:omfwd' resumed (module 'builtin:omfwd') [v8.2302.0 try https://www.rsyslog.com/e/2359 ]

on the remote side. This is unexpected by the average user and a default of 5 seconds seems unreasonable for logging with potentially long periods of low or no activity.

This PR changes the default read-timeout to zero resulting in connection to never timeout and thus to never be closed from the plugin side. In case a user sets the timeout, we now print a warning to make the user aware of the behavior.
Furthermore, the PR adds a unit-test for issue #10121.

PR #14837 modified the default read timeout.

Checklist

  • No AI generated code was used in this PR

Related issues

@telegraf-tiger telegraf-tiger bot added area/syslog fix pr to fix corresponding bug plugin/input 1. Request for new input plugins 2. Issues/PRs that are related to input plugins labels Feb 15, 2024
@srebhan srebhan 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 Feb 15, 2024
Copy link
Contributor

@powersj powersj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I did update the message slightly.

Can we not land this in 1.29.5 and instead punt to 1.30?

@srebhan
Copy link
Member Author

srebhan commented Feb 16, 2024

@powersj yeah we can do this, want me to change this to a fix!(...) and mark it a breaking change?

@powersj
Copy link
Contributor

powersj commented Feb 16, 2024

yes please

@srebhan srebhan changed the title fix(inputs.syslog): Change default read timeout to infinite fix!(inputs.syslog): Change default read timeout to infinite Feb 19, 2024
@srebhan
Copy link
Member Author

srebhan commented Feb 21, 2024

@powersj why did you lowercase the message? This is a log-warn and thus should start with a capital letter!

@powersj
Copy link
Contributor

powersj commented Feb 21, 2024

@powersj why did you lowercase the message? This is a log-warn and thus should start with a capital letter!

That is habbit sorry about that; the bigger issue is the overuse of exclamation marks ;)

@powersj
Copy link
Contributor

powersj commented Feb 21, 2024

@srebhan I've added the capital letter back, can you rebase to resolve the conflict?

@powersj powersj removed their assignment Feb 21, 2024
@telegraf-tiger
Copy link
Contributor

@srebhan srebhan changed the title fix!(inputs.syslog): Change default read timeout to infinite fix(inputs.syslog)!: Change default read timeout to infinite Feb 21, 2024
@DStrand1 DStrand1 assigned srebhan and unassigned DStrand1 Feb 22, 2024
@srebhan srebhan changed the title fix(inputs.syslog)!: Change default read timeout to infinite docs(inputs.syslog): Document change of default read timeout to infinite Feb 26, 2024
@telegraf-tiger telegraf-tiger bot added the docs Issues related to Telegraf documentation and configuration descriptions label Feb 26, 2024
@srebhan srebhan merged commit b836bc1 into influxdata:master Feb 26, 2024
29 checks passed
@srebhan srebhan deleted the syslog_issue_10121 branch February 26, 2024 10:51
@srebhan srebhan removed the fix pr to fix corresponding bug label Feb 26, 2024
@github-actions github-actions bot added this to the v1.30.0 milestone Feb 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/syslog docs Issues related to Telegraf documentation and configuration descriptions 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.

3 participants