hashicorp / go-plugin

Golang plugin system over RPC.
Mozilla Public License 2.0
5.25k stars 450 forks source link

exec: Stdout already set #315

Open jgbooks opened 2 months ago

jgbooks commented 2 months ago
type CmdRunner struct {
    logger hclog.Logger
    cmd    *exec.Cmd

    stdout io.ReadCloser
    stderr io.ReadCloser

    // Cmd info is persisted early, since the process information will be removed
    // after Kill is called.
    path string
    pid  int

    addrTranslator
}

When executing the kill command to terminate a child process, I found that the runner did not close the stdout and stderr.