I'm running an App Engine app written in Go locally with the development server and hitting the API with requests 1/s with roughly 100k-1MB JSON data.
From time to time the server prints an error trace but still continues to serve requests:
socket.error 41
Traceback (most recent call last):
File "/Users/foo/go_appengine/lib/cherrypy/cherrypy/wsgiserver/wsgiserver2.py", line 1302, in communicate
req.respond()
File "/Users/foo/go_appengine/lib/cherrypy/cherrypy/wsgiserver/wsgiserver2.py", line 831, in respond
self.server.gateway(self).respond()
File "/Users/foo/go_appengine/lib/cherrypy/cherrypy/wsgiserver/wsgiserver2.py", line 2127, in respond
self.write(chunk)
File "/Users/foo/go_appengine/lib/cherrypy/cherrypy/wsgiserver/wsgiserver2.py", line 2188, in write
self.req.write(chunk)
File "/Users/foo/go_appengine/lib/cherrypy/cherrypy/wsgiserver/wsgiserver2.py", line 879, in write
self.conn.wfile.sendall(chunk)
File "/Users/foo/go_appengine/lib/cherrypy/cherrypy/wsgiserver/wsgiserver2.py", line 970, in sendall
bytes_sent = self.send(data)
File "/Users/foo/go_appengine/lib/cherrypy/cherrypy/wsgiserver/wsgiserver2.py", line 977, in send
bytes_sent = self._sock.send(data)
error: [Errno 41] Protocol wrong type for socket
The client is in a loop doing:
func call(url string, data []byte) error {
r, err := http.Post(url, "application/json", bytes.NewReader(data))
if err != nil {
return err
}
defer r.Body.Close()
if r.StatusCode != http.StatusCreated {
return fmt.Errorf("unexpected status code %d", r.StatusCode)
}
return nil
}
Golang App Engine SDK is now 1.9.26 and I had 1.9.25 before with the same issue.
I have unsuccessfully found anything online that would help me understand the issue.
Does anyone have an idea what this might be caused by?
This appears to be an error bubbling-up from wsgiserver2.py
's use of python sockets, since many other references to "error 41" and "Protocol wrong type for socket" show up on the net as python sockets
-module-related.
I think given the intermittent nature of this problem that it's likely an issue on the platform. In such a case, you should file an issue report in the public issue tracker containing enough code to reproduce the issue, or an attached app which can reproduced the issue.
Best of luck in filing that issue report!