V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
cat
V2EX  ›  问与答

函数计算部署 egg.js 一定概率触发 Process exited unexpectedly before completing request 可能是什么原因?

  •  1
     
  •   cat · Sep 30, 2020 · 1716 views
    This topic created in 2035 days ago, the information mentioned may be changed or developed.

    困扰了一周的问题,实在无奈,求助万能的 V2 。

    在阿里云的函数计算 部署了 egg.js 做的网站,有一定概率会触发 502 错误,body 为:

    { "errorMessage": "Process exited unexpectedly before completing request (duration: 0ms, maxMemoryUsage: 159.23MB)" }
    

    有个高概率触发技巧: 以 POST 请求、在一两次正常请求后过个一分钟左右,再请求,大概率会报错;

    这个函数的 template.yml 是如下:

    Handler: "index.handler"
    Runtime: "custom"
    CodeUri: "./"
    MemorySize: 192
    InstanceConcurrency: 5
    Timeout: 120
    

    自定义环境的 bootstrap 如下:

    #!/bin/bash
    export PORT=9000
    export EGG_SERVER_ENV=prod
    npx --no-install egg-scripts start --workers=1
    

    专门开了日志服务,也没记录到相关的错误信息,实在没头绪。

    请教各位大佬,这个错误可能是在哪个环节产生的?先谢谢了!

    1 replies    2020-10-01 13:17:24 +08:00
    cat
        1
    cat  
    OP
       Oct 1, 2020 via iPhone
    顶顶… 昨晚折腾一晚上还是没头绪…
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1139 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 23:07 · PVG 07:07 · LAX 16:07 · JFK 19:07
    ♥ Do have faith in what you're doing.