-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fixes #1448 #1449
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
Closed
Closed
Fixes #1448 #1449
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
docker-java/src/test/resources/closeStdinWithStdinOnce/Dockerfile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| FROM busybox:latest | ||
|
|
||
| ADD echo_stdin.sh /tmp/ | ||
|
|
||
| RUN mkdir -p /usr/local/bin | ||
| RUN cp /tmp/echo_stdin.sh /usr/local/bin/ && chmod +x /usr/local/bin/echo_stdin.sh | ||
|
|
||
| CMD ["echo_stdin.sh"] | ||
|
|
7 changes: 7 additions & 0 deletions
7
docker-java/src/test/resources/closeStdinWithStdinOnce/echo_stdin.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| #!/bin/sh | ||
| # Read the marker line to echo it after stdin is closed | ||
| read -r marker_line_after_eof_from_stdin | ||
| # Echo all lines received from stdin | ||
| while read -r line; do echo "$line"; done | ||
| # Show that stdout still function after closing stdin | ||
| echo "$marker_line_after_eof_from_stdin" |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it a WIP or you was unable to fix it for AHC5?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I addressed this problem because my colleague at JetBrains stuck into the situation where our Python helper script misbehaved. And we use only OkHttp implementation.
However I dived into AHC5 implementation. It has pretty similar
UnixDomainSocketclass. But fixing only this class does not help becauseorg.apache.hc.core5.http.impl.io.ContentLengthOutputStream.close()does not callclose()method on underlyingoutputStream(which belongs toUnixDomainSocketthat could be fixed) and, unfortunately,ContentLengthOutputStreamclass is situated inorg.apache.httpcomponents.core5:httpcore5:5.0artifact.Here is the stacktrace where magic does not happen:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have investigated the problem in AHC5 implementation. Although the
org.apache.hc.core5.http.impl.io.ContentLengthOutputStream.close()method does not close the underlyingOutputStream, it is possible to shut down theOutputStreamincom.github.dockerjava.httpclient5.HijackingHttpRequestExecutorclass right afterconn.sendRequestEntity(fakeRequest);call:However, for that to work, similar changes to the
UnixDomainSocketclass (under docker-java-transport-httpclient5) are needed because, by default,UnixDomainSocket.shutdownOutput()does nothing.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mrtamm thanks for investigating, this is very helpful!
@tejksat will you be able to apply the changes as per @mrtamm's advice?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@tejksat gentle ping :)