Fix issue with jersey and unix domain sockets#697
Conversation
pom.xml
Outdated
| <artifactId>junixsocket-native-common</artifactId> | ||
| <version>${junixsocket.version}</version> | ||
| </dependency> | ||
| <dependency> |
There was a problem hiding this comment.
Dependency to jnr-unixsocket must be removed...
d410911 to
066f177
Compare
pom.xml
Outdated
| <!-- </extension> --> | ||
| <!-- </extensions> --> | ||
| <!-- <extensions> --> | ||
| <!-- <extension> --> |
|
👍 |
|
@KostyaSha What is the difference between the two travis builds |
|
Obviously pull request and branch build ;) |
|
So if you don't plan cooperate on branch, then do branch in your fork and open PR. |
retriggering build |
Current coverage is 71.09% (diff: 47.03%)@@ master #697 diff @@
==========================================
Files 300 302 +2
Lines 6202 6484 +282
Methods 0 0
Messages 0 0
Branches 528 585 +57
==========================================
+ Hits 4422 4610 +188
- Misses 1531 1594 +63
- Partials 249 280 +31
|
|
Also place somewhere in javadoc why clases was copied. |
ea6bdbc to
e51b898
Compare
e51b898 to
d6610ab
Compare
|
@marcuslinke please set milestones before merge and update changelog after merge |
|
|
@marcuslinke where ChunkedInputStream is used? or do you trying replace classes? Classes are messed.. |
|
On mac after shading i have Will try compare with linux env and plain docker-java. |
|
M... it impossible relocate java class because it depends on native library? |
|
@KostyaSha Yes, I've replaced two classes as described in the first comment. Didn't know that this is a problem with shading... :( |
|
Well, it warning, but having conflicting package-class is questionable. |
|
Yes, thats ugly but fixing this in upstream projects (apache HTTPCore AND junixsockets) would take ages I think. |
|
You cannot simply copy a class an expect it to shadow a class from a dependency. This all depends on classloading order, which can be non-deterministic in some cases (such as packaging multiple jars in a war or ear). Your only options are to get this fixed upstream or to work around this some other way. The currently solution breaks our build because the maven-enforcer-plugin detects duplicate classes. |
|
My project became a victim of the class loading order issue :) |
and because we no longer need our custom version of AFUNIXSocketImpl from docker-java#697
This eliminates the socket already closed exception (org.newsclub.net.unix.AFUNIXSocketException: Bad file descriptor). The problem occurs when the underlying connection of a stream is closed and chunked encoding is active. The apache
ChunkedInputStreamstill tries to read till the end of the current chunk whileclose()ing itself. This is not possible as the connection/socket is already closed.Sadly it needs to fix two classes
AFUNIXSocketImplandChunkedInputStreamto solve the issue.This change is