Skip to content
This repository has been archived by the owner on Jan 8, 2024. It is now read-only.

send "EOF" event for stdin through exec session when stdin is closed #830

Merged
merged 1 commit into from
Nov 20, 2020

Conversation

mitchellh
Copy link
Contributor

This adds "EOF" awareness for stdin to exec so that stdin can be
properly closed on the remote side. Without this, some processes would
hang indefinitely waiting for stdin to close. For example, if you run
cat | ls (just normally, not via Waypoint), ls hangs forever since it
is waiting for stdin to close.

For non-interactive stdout and an interactive stdin, we treat stdin as
closed. This seems to align with how other Unix tools treat stdin in
this case (such as ls).

This change requires a full client, server, entrypoint update to work,
but is backwards compatible throughout and just falls back to the same
buggy behavior.

Fixes #826

This adds "EOF" awareness for stdin to exec so that stdin can be
properly closed on the remote side. Without this, some processes would
hang indefinitely waiting for stdin to close. For example, if you run
`cat | ls` (just normally, not via Waypoint), ls hangs forever since it
is waiting for stdin to close.

For non-interactive stdout and an interactive stdin, we treat stdin as
closed. This seems to align with how other Unix tools treat stdin in
this case (such as ls).

This change requires a full client, server, entrypoint update to work,
but is backwards compatible throughout and just falls back to the same
buggy behavior.

Fixes #826
@mitchellh mitchellh merged commit e008397 into main Nov 20, 2020
@mitchellh mitchellh deleted the b-exec-no-tty branch November 20, 2020 01:02
mitchellh added a commit that referenced this pull request Nov 20, 2020
send "EOF" event for stdin through exec session when stdin is closed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

waypoint exec hangs when not executed on terminal
3 participants