Skip to content

.timeout() functionality does not work on payload processes with children #167

Open
@mrkmndz

Description

@mrkmndz

The implementation of timeout implemented in #92 does not work as intended for payload processes with children.

Namely, it will get stuck here:

        let stdout = stdout
            .and_then(|t| t.join().unwrap().ok())
            .unwrap_or_default();

waiting for the stdout to EOF, while the "grandchild" process happily keeps that fd open indefinitely.

In order to behave as expected, we need to explicitly kill all transitive children of the payload process here:

                .unwrap_or_else(|| {
                    let _ = child.kill();
                    child.wait()
                })

or at least apply some sort of timeout logic on the read threads.

cc @epage

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions