EOF during http.Client.Do()

7,869 views
Skip to first unread message

Edward Muller

unread,
Feb 20, 2014, 9:23:13 PM2/20/14
to golang-nuts
I send a lot of data via golang"s http.Client.Do() and sometimes get EOF errors.

AFAICT I get EOFs because the underlying network connection has closed and I can no longer send or read the bytes I expect to read/send.

But given the structured nature of http streams I'd expect to get ErrUnexpectedEOF in that case.

What am I missing?

--
Edward Muller
@freeformz

James Bardin

unread,
Feb 20, 2014, 9:47:38 PM2/20/14
to golan...@googlegroups.com
I fairly certain that you get a plain EOF if the connection is closed before or while the headers are read. This is usually from a keepalive connection that the server closed remotely.

Edward Muller

unread,
Feb 20, 2014, 9:54:03 PM2/20/14
to James Bardin, golang-nuts
Both of the services on the other side are our services and one is written in go, the other erlang, although in both cases Amazon's ELBs sits between my client and the services. I get EOFs from either service at different times.


--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



--
Edward Muller
@freeformz

Edward Muller

unread,
Feb 20, 2014, 11:20:25 PM2/20/14
to James Bardin, golang-nuts
I also looked at this thread: https://groups.google.com/forum/#!msg/golang-nuts/HsaLNTMq3eI/-f2tRTMEnYoJ

I'm mostly doing POSTs though, not GETs so a retry loop isn't a super good solution, at least until I can be fairly certain I know what's going on.

FWIW: The other side (which logs request_ids) doesn't seem to be logging the request_id of requests that EOF'd.

There is still the ELB in the middle of course, but I pretty much need that.

It's also impossible to capture a traffic dump as everything is over https (at least to the ELB).

--
Edward Muller
@freeformz

Edward Muller

unread,
Feb 20, 2014, 11:44:01 PM2/20/14
to James Bardin, golang-nuts
Also wondering if I could be running into this: https://code.google.com/p/go/issues/detail?id=3514

although I don't se related 503's before hand
--
Edward Muller
@freeformz

prasad....@gmail.com

unread,
Jan 30, 2018, 5:28:15 PM1/30/18
to golang-nuts
Did you find the root cause for this. I am getting the same issue.

rampant...@gmail.com

unread,
Feb 6, 2018, 8:33:09 AM2/6/18
to golang-nuts
I am seeing this as well when connecting to haproxy 1.8 locally.
About 1 in 1000 requests. They all seem to have the "Connection: Close" header FWIW.
The backends behind haproxy never see the request.
Reply all
Reply to author
Forward
0 new messages