There are some exceptions from my running GCF (--runtime python37 --trigger-topic <pubsub_topic> --retry
).
They are all from this IP 169.254.8.129
which should be GCP internal IP and maybe the supervisor of GCF. I google this IP and grab the deploy output (via Node)
{
“SUPERVISOR_HOSTNAME”: “169.254.8.129”,
...
“X_GOOGLE_SUPERVISOR_HOSTNAME”: “169.254.8.129”,
}
(https://rominirani.com/google-cloud-functions-tutorial-using-environment-variables-20b4f0f82aa0)
From Stackdriver Logs, the GCF will have ConnectionResetError after this exception, and then this GCF will exit with failure errors.
"Traceback (most recent call last):
File "/opt/python3.7/lib/python3.7/wsgiref/handlers.py", line 138, in run
self.finish_response()
File "/opt/python3.7/lib/python3.7/wsgiref/handlers.py", line 180, in finish_response
self.write(data)
File "/opt/python3.7/lib/python3.7/wsgiref/handlers.py", line 274, in write
self.send_headers()
File "/opt/python3.7/lib/python3.7/wsgiref/handlers.py", line 332, in send_headers
self.send_preamble()
File "/opt/python3.7/lib/python3.7/wsgiref/handlers.py", line 252, in send_preamble
self._write(('HTTP/%s %s\r\n' % (self.http_version,self.status)).encode('iso-8859-1'))
File "/opt/python3.7/lib/python3.7/wsgiref/handlers.py", line 453, in _write
result = self.stdout.write(data)
File "/opt/python3.7/lib/python3.7/socketserver.py", line 796, in write
self._sock.sendall(b)
ConnectionResetError: [Errno 104] Connection reset by peer"
Is it one bug of GCF? How to prevent this exception from developer's perspective?