函数执行异常退出,报错Process exited unexpectedly before completing request怎么办?
更新时间:
函数执行异常退出,可能存在以下问题,你可以根据不同问题采取不同的措施。
函数本身逻辑错误,多见于下游数据库问题,示例代码如下。您可以增加日志功能,根据日志调试解决。
# -*- coding: utf-8 -*- import os import logging def handler(event, context): logger = logging.getLogger() logger.info('something is wrong') os._exit(-1) return 'hello world'
如果您的函数是Custom Runtime或者Custom Container函数,可能创建HTTP Server时,Connection未设置为Keep-Alive,且函数的执行超时时间小于15分钟。更多信息,请参见HTTP Server配置要求。
反馈
- 本页导读 (1)
文档反馈