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

Set conn close log level to debug #1139

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions internal/clientio/iohandler/netconn/netconn.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ func (h *IOHandler) Read(ctx context.Context) ([]byte, error) {
// No more data to read at this time
return data, nil
case errors.Is(err, net.ErrClosed), errors.Is(err, syscall.EPIPE), errors.Is(err, syscall.ECONNRESET):
h.logger.Error("Connection closed", slog.Any("error", err))
h.logger.Debug("Connection closed", slog.Any("error", err))
cerr := h.Close()
if cerr != nil {
h.logger.Warn("Error closing connection", slog.Any("error", errors.Join(err, cerr)))
Expand Down Expand Up @@ -186,7 +186,7 @@ func (h *IOHandler) Write(ctx context.Context, response interface{}) error {
err = errors.Join(err, cerr)
}

h.logger.Error("Connection closed", slog.Any("error", err))
h.logger.Debug("Connection closed", slog.Any("error", err))
return err
}

Expand Down
2 changes: 1 addition & 1 deletion internal/worker/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func (w *BaseWorker) Start(ctx context.Context) error {
case err := <-errChan:
if err != nil {
if errors.Is(err, net.ErrClosed) || errors.Is(err, syscall.EPIPE) || errors.Is(err, syscall.ECONNRESET) {
w.logger.Error("Connection closed for worker", slog.String("workerID", w.id), slog.Any("error", err))
w.logger.Debug("Connection closed for worker", slog.String("workerID", w.id), slog.Any("error", err))
return err
}
}
Expand Down