Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't close channels when a PID hasn't started #326

Merged
merged 1 commit into from
Oct 21, 2024
Merged

Conversation

mkj
Copy link
Owner

@mkj mkj commented Oct 4, 2024

If check_close() ran prior to a server channel exec/shell request, it would send a close immediately.
This fix changes it to exclude write_fd==FD_UNINIT from being closed there.

When a channel was closed by the time shell/exec request was received, then data sent hits an assertion.
This fixes #321 on Github.

The "pid == 0" check was initially added to avoid waiting to close a channel when a process has never been launched (which is correct), but that isn't correct in the case of the closed-fd test.

Fixes: 8e6f73e ("- Remove "flushing" handling for exited processes)

If check_close() ran prior to a server channel exec/shell
request, it would send a close immediately.
This fix changes it to exclude write_fd==FD_UNINIT from
being closed there.

When a channel was closed by the time shell/exec request
was received, then data sent hits an assertion.
This fixes #321 on Github.

The "pid == 0" check was initially added to avoid waiting
to close a channel when a process has never been launched
(which is correct), but that isn't correct in the case
of the closed-fd test.

Fixes: 8e6f73e ("- Remove "flushing" handling for exited processes)
@mkj mkj merged commit 71521d1 into master Oct 21, 2024
17 checks passed
@mkj mkj deleted the pr/early-channel-close branch October 21, 2024 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

failed assertion in common-channel.c:705: `!channel->sent_close'
1 participant