alfiankan/teleterm

use bash -c maybe leak chaild process

Closed this issue · 3 comments

cmd := exec.Command(executor, "-c", command)

if the bash exit, but child process is not exit, the child process will always running.

are u running long running processes? i think i need to make execution as queue worker what do u think?

so when we send command actually teleterm will dispatch new worker to execute sub process and get the output result and then send back to telegram

and we can add default timeout to avoid child process leak

I think add default timeout is a good choice, but the parent process is bash, when timeout reached the bash will exit, but the real process(child process) will not exit.
Maybe need kill all child process first, then kill bash.

i see i need to reproduce that, will update asap