我正在运行的GCF(--runtime python37 --trigger-topic <pubsub_topic> --retry
)有一些例外。
全部来自此IP 169.254.8.129
,该IP应该是GCP内部IP,也可能是GCF的主管。我用这个IP谷歌搜索并通过节点获取部署输出
{
“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)
在Stackdriver Logs中,此异常之后GCF将具有 ConnectionResetError ,然后此GCF将退出并显示错误错误。
"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"
这是GCF的一个错误吗?从开发人员的角度来看如何防止这种异常?