-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Description
Our serverside application, currently on 0.18, does http the occasional http request to the Google APIs. Sometimes, I think, google closes the connection on us and the application dies with SIG_PIPE:
...
keyprovision_google.nim(66) getAccessToken
keyprovision_google.nim(30) requestJson
keyprovision_google.nim(71) :anonymous
httpclient.nim(1196) request
httpclient.nim(1181) requestAux
httpclient.nim(1031) parseResponse
httpclient.nim(883) close
net.nim(866) close
SIGPIPE: Pipe closed.
Of course, the http request() is wrapped into try/except; that does not catch the signal however.
This is running on nim 0.18 (I can't try 0.19 yet, porting it is significant effort due to libraries used), and in a docker container on Linux.
I found this thread: https://forum.nim-lang.org/t/4417, but that didn't really help. The httpclient is already configured to use a reasonable timeout (3s).
I'm fairly certain this is because Google is closing the kept-alive connection in the background; but I'm hesitant to add Connection: Close (or otherwise close the connection on our end) unless that's the only way to solve this.