-
-
Notifications
You must be signed in to change notification settings - Fork 946
Fix ShellStream.Read returning 0 prematurely #923
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
Conversation
@IgorMilavec This will block indefinitely if the last "line" does not end with a line ending. I have an integration test locally that allows you to reproduce this, but I'd really like you to have a go at this too. Let me know if you need any help or guidance. |
|
A few other remarks:
|
@IgorMilavec Yes, I have a test for this but - as I said - I'd really prefer you also take a stab at this hereby hoping to convince you of the added value of these integration tests. |
It reproduces when you use a StreamReader to read content of a ShellStream that is closed while reading. |
Yes, I am aware that there are issues with closing the stream. Currently this PR only fixes #63. As I said, I already have other fixes ready, but I need your decision whether to add these changes to this PR? |
@IgorMilavec We shouldn't merge this without a minimal fix that avoids a "hang" when the channel is closed, and corresponding tests. |
@drieseng I have committed the changes required to handle session/channel closing. There were quite a bit of changes, mostly due to the fact that all Read* and Expect* methods directly handle internal state. Can you please have a look? |
|
Hello @IgorMilavec @drieseng , any plan to publish new version with bugs mentioned above fixed? |
I repeat the @glorialearnscoding question, do you plan to publish fixes for that issues? |
@jscarle Note to self. @IgorMilavec I'd like to understand what your original plan was with this PR as ShellStream has changed enough that the diff is quite messy and I'd like to take a look at addressing this. |
Fixes
ShellStream.Read
to block until more data is received or the session is closed.This will fix #63