Open nitishfy opened 8 months ago
Thanks for raising this followup https://github.com/etcd-io/etcd/pull/17423#discussion_r1489264573
Related to: https://github.com/etcd-io/etcd/issues/17329
There was a discussion related to the setting up serving from embedded etcd failed.
error in one of the PRs I made. Linking the discussion here for future reference: https://github.com/etcd-io/etcd/pull/18806#discussion_r1822106873
Think we can explore idea by @ghouscht to not log some errors that are expected during shutdown presented in https://github.com/etcd-io/etcd/pull/18806#discussion_r1822155553. For example ErrServerClosed implies that server "Shutdown" or "Close" was called, meaning it was expected https://cs.opensource.google/go/go/+/refs/tags/go1.23.2:src/net/http/server.go;l=3286-3288;drc=773767def0e0f29584a69bd760430167b7479d7d.
For example ErrServerClosed implies that server "Shutdown" or "Close" was called, meaning it was expected
The problem is it's uncertain why the server or connection is closed. It might be normal or abnormal cases. It'd be better to log a message if err != nil, at least we should log a warning message for such cases.
I think we can read the code and follow why Shutdown
was called.
Bug report criteria
What happened?
While trying to write test case for the #17329, I encountered that there were a lot of error logs that were present. Logs are used to provide useful debug information to users, however, if mislabeled they could cause user to lose trust and ignore errors. For error logs to be useful they should only be emitted where there is something wrong.
We should prevent issues like https://github.com/etcd-io/etcd/issues/17245 where a change in code started generating a large number of error logs.
Proposed in https://github.com/etcd-io/etcd/pull/17249#issuecomment-1893399469 with agreement between maintainers.
What did you expect to happen?
In an ideal scenario, there should be no error logs since everything is running perfectly well.
How can we reproduce it (as minimally and precisely as possible)?
Anything else we need to know?
No response
Etcd version (please run commands below)
Etcd configuration (command line flags or environment variables)
Etcd debug information (please run commands below, feel free to obfuscate the IP address or FQDN in the output)
Relevant log output