2

--runtime python37 --trigger-topic <pubsub_topic> --retry我正在运行的 GCF ( )有一些例外。

他们都来自这个IP 169.254.8.129,应该是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 的一个错误吗?从开发人员的角度来看,如何防止这种异常?

4

0 回答 0