Skip to content

Show the error of gw.Close() #89

@humingcheng

Description

@humingcheng

What version of Go are you using (go version)?

go version go1.12.9 windows/amd64

What operating system and processor architecture are you using?

set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\hmc\AppData\Local\go-build
set GOEXE=.exe
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
set GOPATH=C:\Users\hmc\go
set GOPROXY=
set GORACE=
set GOROOT=C:\go
set GOTMPDIR=
set GOTOOLDIR=C:\go\pkg\tool\windows_amd64
set GCCGO=gccgo
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=C:\Users\hmc~1\AppData\Local\Temp\go-build408318050=/tmp/go-build -gno-record-gcc-switches

What did you do?

I startded a http server with gzip handler, with the server's param WriteTimeout set to a certain value. Then I made a request who's handle time was longer than the WriteTimeout.

What did you expect to see?

Get some logs or errors about the WriteTimeout error.

What did you see instead?

Nothing. Only saw that the connection was closed and nothing responsed.

This issue is similar to net/http: ResponseWriter.Write does not error after WriteTimeout nor is ErrorLog used. But the difference is that, gw.Close() is called in a gzip handler and it returns an error, maybe there is a way to show the error or give it to users? In my scenario, gw.Close() returned an error of internal/poll.TimeoutError, and it helped me to find my server's issue. So I think showing the error of gw.Close() helps the users.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions