-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Bug: Caddy freezes when syslog server not available #4083
Comments
I'm not super familiar with the Caddy codebase but here's what I'm seeing: In https://github.com/caddyserver/caddy/blob/master/modules/logging/netwriter.go#L78 it attempts to connect to the server which causes Caddy to lock up. I'm not sure how to solve this. We could use a goroutine to set up logging and use the default logger until then but that could cause some messages to get lost. Or we use a context deadline but that wouldn't solve the downtime issue. I think the others can give more insight into this. |
I think the best solution would be to not configure Caddy to use a log server that isn't available? |
@mholt considering that initially the syslog server is available, but suddenly its not reachable, this problem will persist and impact the caddy server, right? |
I haven't had much time to spend on this, but I pushed a potential patch in #4172 -- could you all please try it out? Configure a dial timeout and it should unblock the server so it can keep working, it just might still be slow (once in a while). Let me know the details of your experience with it and we can smooth out any rough edges. |
* logging: Implement dial timeout for net writer (fix #4083) * Limit how often redials are attempted This should cause dial blocking to occur only once every 10 seconds at most, but it also means the logger connection might be down for up to 10 seconds after it comes back online; oh well. We shouldn't block for DialTimeout at every single log emission. * Clarify offline behavior
Hello,
I had a power outage over the weekend and noticed an issue with one of my sites, when looking into the issue, caddy was locking up whenever browsing the one domain that uses a syslog output
Is the config that is being used. Is this behavior expected? or am I breaking something?
The text was updated successfully, but these errors were encountered: