-
-
Notifications
You must be signed in to change notification settings - Fork 113
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
HttpDuplex.end() breaks output #48
Comments
Also if I do:
Then everything works as expected... So perhaps we don't need the |
Update... I've just realized that I loose some initial output if I use |
@EggyLv999, any chance you can take a look at this. |
Also having this issue, being unable to manually end the connection |
Tried your fix @jonasfj, worked for me. Making a fork for now |
@JohnyDays, I experienced other issues with my fix. I suspect the best solution is to send the |
I was using the logs() function to monitor logging and look for a signal that a certain container is ready for action. But it just wasn't working, there was no reliable way to close the connection that did not result in disaster. So I am now polling the logs every X seconds (with a slight modification in a fork, not to use streams) and checking that way |
FYI https://github.com/mafintosh/docker-remote-api does not have this issue. |
This issue is a bit (a lot) old, lost track of it, since then (long time ago) we have implemented hijacking. Described in here: https://github.com/apocas/dockerode#streams-goodness Do you have this issue using hijacking? |
Nope I did not try, the test I wrote back in 2015 showed the issue: apocas/dockerode#136 <apocas/dockerode#136> the way it was re-written was not right because it did not use the stream to end the connection but the exit command.
Did
… On 10 Mar 2017, at 23:00, Pedro Dias ***@***.***> wrote:
This issue is a bit old, lost track of it, since then we have implemented hijacking.
Described in here: https://github.com/apocas/dockerode#streams-goodness <https://github.com/apocas/dockerode#streams-goodness>
Do you have this issue using hijacking?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub <#48 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/ABJCEpEyHv7FgvG8rVfm1BLvE2Z5oMr8ks5rkcfxgaJpZM4FoQ0r>.
|
So playing with attach streams... specifically for
docker exec
, I've found that you can't end the stdin stream... TheHttpDuplex.end()
implementation breaks the TCP stream - not just closing this side.So if you do the equivalent of
echo "test" | docker exec CONTAINER wc -c
you don't get the expected output.Looking at the docker implementation, it seems that we should:
Connection: upgrade
andUpgrade: tcp
headers, see docker cli code.HttpDuplex
only closes this side of the request (should be the same right?).Either way, this seems to fix my issue:
Not sure why I'm having to close the TCP socket. It ought to just end on it's own.
Current code does
this._output.socket.destroy();
which is probably why I miss any output arriving after stdin is closed.The text was updated successfully, but these errors were encountered: