Skip to content

ngx.pipe.spawn shell mode child process not killed after openresty exits #1855

@fffonion

Description

@fffonion

When using ngx.pipe.spawn in shell mode (args is a string), sh -c in invoked internally.
While OpenResty exists, SIGKILL is sent to sh process, but it's not able to propogate to child process.
The child process is then left alive.

POC:

init_work_by_lua_block {
  require("ngx.pipe").spawn("/tmp/a.py")
}

$ cat /tmp/a.py:

#!/usr/bin/env python3
import time
time.sleep(23333)

Then signal stop the OpenResty/Nginx process.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions