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

Fixed stdout/stderr cut off bug when using RemoteChild::wait_with_output #104

Merged
merged 27 commits into from
Nov 7, 2022

Conversation

NobodyXu
Copy link
Member

@NobodyXu NobodyXu commented Oct 29, 2022

Fixed #103

This PR fixed two bugs:

  • Fix Fd::as_raw_fd_or_null_fd in native-mux: Disable non-blocking on all fds before passing them to the ssh multiplex server
  • Fix RemoteChild::wait_with_output: Await on self.wait() after stdout/stderr is fully read in, otherwise the ssh multiplex server would stop writing data to stdout/stderr once self.wait() is done (which drops the connection to the server)

Signed-off-by: Jiahao XU [email protected]

@jonhoo
Copy link
Collaborator

jonhoo commented Oct 29, 2022

This change is Reviewable

@NobodyXu NobodyXu requested a review from jonhoo October 29, 2022 11:47
@NobodyXu
Copy link
Member Author

@jonhoo P.S. I would like to squash merge this PR and edit the commit messages since I inverted some commits.

@codecov-commenter
Copy link

codecov-commenter commented Oct 29, 2022

Codecov Report

Merging #104 (908141c) into master (5282f39) will decrease coverage by 0.63%.
The diff coverage is 63.79%.

Additional details and impacted files
Impacted Files Coverage Δ
src/stdio.rs 54.63% <0.00%> (-2.36%) ⬇️
src/native_mux_impl/stdio.rs 84.09% <72.91%> (-9.39%) ⬇️
src/child.rs 89.74% <100.00%> (-0.26%) ⬇️
src/session.rs 75.30% <0.00%> (-0.31%) ⬇️

@NobodyXu
Copy link
Member Author

@Fuuzetsu Can you test this PR to see if it fixed the bug for you please?

@NobodyXu NobodyXu requested a review from jonhoo October 30, 2022 01:16
@NobodyXu NobodyXu requested a review from jonhoo October 30, 2022 23:38
@Fuuzetsu
Copy link

@Fuuzetsu Can you test this PR to see if it fixed the bug for you please?

I checked with 0bb7ad3 and I'm now getting the stdout in full with native-mux. I only tried a couple of times.

@NobodyXu
Copy link
Member Author

I checked with 0bb7ad3 and I'm now getting the stdout in full with native-mux. I only tried a couple of times.

Thanks!
If you encountered the problem again when using this PR, feel free to post it here.

@NobodyXu NobodyXu requested a review from jonhoo October 31, 2022 02:03
@NobodyXu NobodyXu requested a review from jonhoo October 31, 2022 05:25
Do not `set_blocking` on `StdioImpl::inherit` as we do not own them
and also do not `set_blocking` on `Stdio` constructed using
`FromRawFd::from_raw_fd`

Signed-off-by: Jiahao XU <[email protected]>
Signed-off-by: Jiahao XU <[email protected]>
@NobodyXu NobodyXu requested a review from jonhoo October 31, 2022 23:55
@NobodyXu NobodyXu requested a review from jonhoo November 7, 2022 00:46
@jonhoo
Copy link
Collaborator

jonhoo commented Nov 7, 2022

Oh, can you update the changelog as well?

Signed-off-by: Jiahao XU <[email protected]>
Signed-off-by: Jiahao XU <[email protected]>
@NobodyXu
Copy link
Member Author

NobodyXu commented Nov 7, 2022

Oh, can you update the changelog as well?

I've updated the changelog.

@jonhoo jonhoo merged commit e1efac5 into master Nov 7, 2022
@jonhoo jonhoo deleted the fix/cut-off branch November 7, 2022 01:10
@NobodyXu
Copy link
Member Author

NobodyXu commented Nov 7, 2022

P.S. codecov CI seems to fail due to the invalid token:

[2022-11-07T01:01:09.453Z] ['error'] There was an error running the uploader: Error uploading to [https://codecov.io:](https://codecov.io/) Error: There was an error fetching the storage URL during POST: 404 - {'detail': ErrorDetail(string='Unable to locate build via Github Actions API. Please upload with the Codecov repository upload token to resolve issue.', code='not_found')}
Error: Codecov: Failed to properly upload: The process '/home/runner/work/_actions/codecov/codecov-action/v2/dist/codecov' failed with exit code 255

@jonhoo
Copy link
Collaborator

jonhoo commented Nov 7, 2022

Oops, I forgot to squash.. Oh well!

@jonhoo
Copy link
Collaborator

jonhoo commented Nov 7, 2022

Published in 0.9.8 🎉

@jonhoo
Copy link
Collaborator

jonhoo commented Nov 7, 2022

I think that CI failure is probably temporary

@NobodyXu
Copy link
Member Author

NobodyXu commented Nov 7, 2022

I think that CI failure is probably temporary

That indeeds seems so since it worked again on master branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

wait_with_output + native-mux cuts off stdout output
4 participants