-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
log/syslog: reconnect on server restart #2264
Labels
Milestone
Comments
patch against release with testcase. http://golang.org/cl/5078042/ Attachments:
|
This issue was closed by revision 33995fe. Status changed to Fixed. |
Yes, it is working as designed. The idea is that this standard library should ensure that in the common case where the opened connection has "gone stale" because the syslog server has been restarted hours or minutes or seconds before, the application will refresh the connection and send the log message. But, being a piece of the standard library, it should not be too heavy, and cover every possible kind of retry logic. Instead, it should give a useful error that callers can use. In the case where there's a race and the syslog client fails to write because the syslog server is going down, then retries and fails, then the syslog server starts, Write will return an error one time and the message will be lost. On the next call to Write, it will reconnect and messages will be passed. If you need to be absolutely, positively sure the message is logged, you can't use syslog anyway, because the rest of the design of syslog servers is not usually 100% safe. If you want to wait and retry when Write returns an error, you'd need to wrap calls to Write to do that; but then you need to consider the impact this could have on callers to Write, who might expect it to return immediately. Hope this is helpful. |
This issue was closed.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
by akunokuroneko:
The text was updated successfully, but these errors were encountered: