fixes: #38745 lost UnixConn features in listener socket read hack#38928
fixes: #38745 lost UnixConn features in listener socket read hack#38928lifubang wants to merge 1 commit intomoby:masterfrom
Conversation
|
For 262144 bytes = 256KB |
afafc8b to
8f2d497
Compare
Codecov Report
@@ Coverage Diff @@
## master #38928 +/- ##
=========================================
Coverage ? 36.91%
=========================================
Files ? 614
Lines ? 45406
Branches ? 0
=========================================
Hits ? 16762
Misses ? 26357
Partials ? 2287 |
|
@runcom @cpuguy83 It's from your commit in 2016. |
There was a problem hiding this comment.
Nit, this is never nil (else it would panic on the type assertion).
There was a problem hiding this comment.
Thank you for your review. I remove the c == nil check and add a ok check.
There was a problem hiding this comment.
Seems weird to allocate buffers and only use them to get the length.
There was a problem hiding this comment.
buf is used in here copy(b, buf), but I also change to a more reasonable way.
There was a problem hiding this comment.
Ah your right, thinking of append, but copy is ok.
Can we update the function name? To me a check shouldn't be modifying things and makes it confusing... maybe stripInvalidHeader
There was a problem hiding this comment.
maybe stripInvalidHeader
OK
79605e5 to
d449b0e
Compare
There was a problem hiding this comment.
Not sure I'm following why this is added.
There was a problem hiding this comment.
Maybe time is too long to remember the reason.
|
docker-py really does not seem to like this change for some reason. I'm wondering if we should consider just removing this hack alltogether at this point. As I recall this was an issue with clients built with < go1.8 which is way out of support... |
Signed-off-by: Lifubang <lifubang@acmcoder.com>
I'll try retest for one more time.
If this hack removed, it works fine. I quite agree with you to remove this hack. Should need any other maintainers to view this remove? |
|
Discussing in the maintainers meeting with @cpuguy83 @wk8, @kolyshkin , and we think it should be ok to remove the hack altogether; this hack was there for clients compiled with Go 1.5 or older, which is 4 years old; if you're using tools that haven't been updated in 4 years, I think that's not something we can take into account. We should add something in the release notes though, just in case someone somewhere still has such old tools 🤗 |
Signed-off-by: Lifubang lifubang@acmcoder.com
- What I did
As mentioned in #38745 , docker will exit with an error when stdin is not fully consumed.
It's very import for my OJ (Online Judge) product, so I want to fix it.
My test case running command is always like this:
If the code in
acmcoder/ab:oncecan't consume all the data in stdin, it will get an error.- How I did it
I have tested it with steps as follows:
-H :2375, there is no error:-H unix:///var/run/docker.sockThe only difference between
tcpandunixishack.In
hack, we just usenet.Conninterface, it will causenet.UnixConn's features lost.So, use
net.UnixConninstead ofnet.Conn.- How to verify it
There is no error.
** Further more **
I don't know what features are lost without
net.UnixConn. If some one can tell me, I'll appreciate very much.- Description for the changelog
Use
net.UnixConninstead ofnet.Connin dockerd listener's data reading hack.- A picture of a cute animal
