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

Show the error of gw.Close() #89

Open
humingcheng opened this issue Sep 2, 2019 · 0 comments
Open

Show the error of gw.Close() #89

humingcheng opened this issue Sep 2, 2019 · 0 comments

Comments

@humingcheng
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant