-
Notifications
You must be signed in to change notification settings - Fork 215
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
Handle zero-byte TCP healthcheck connections #236
Labels
Comments
A connection close should result in EOF I think, not ECONNRESET… |
This is reproducible locally by simply starting the SMTP server listening on localhost:9025, then in a terminal issuing ❯ nc -vz localhost 9025
Connection to localhost port 9025 [tcp/swa-3] succeeded! and in the process running the server we see:
|
I can't reproduce this. |
Similar issue reported for maddy: foxcpp/maddy#646
I think at least EOF should be filtered out. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In an environment like kubernetes hosted on AWS, the server needs to handle health checks from load balancers. A TCP health check only checks that a connection can be established, and then closes without sending any data or waiting for a greeting. go-smtp's Server then logs error messages like
which in the case of most health check intervals (< 5 min) means noisy logs with lots of pointless error messages (the noise is the problem, not any functionality of the Server itself). Instead,
Server.handleConn()
should check whether any bytes were sent and only log an error if the connection was non-empty.The text was updated successfully, but these errors were encountered: