Skip to content
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

Make Unix Domain Socket functionality optional #85

Open
deadok22 opened this issue Aug 14, 2019 · 1 comment
Open

Make Unix Domain Socket functionality optional #85

deadok22 opened this issue Aug 14, 2019 · 1 comment

Comments

@deadok22
Copy link

Not all usages of the library need Unix Domain Socket transport. Let's figure out how to make it optional.

Some wins we can get by making Unix Domain Socket transport optional:

Some approaches we could take to address this:

  1. Split Unix Domain Socket transport to a separate JAR.
  2. Make com.github.jnr:jnr-unixsocket an optional dependency and add some workarounds to prevent eager loading of classes from that JAR.
@JamJar00
Copy link

Another advantage of this is that jnr-unixsocket currently pulls in an LGPL licensed dependency jnr-posix:

[INFO] +- com.datadoghq:java-dogstatsd-client:jar:2.8:compile
[INFO] |  \- com.github.jnr:jnr-unixsocket:jar:0.18:compile
[INFO] |     +- com.github.jnr:jnr-ffi:jar:2.1.4:compile
[INFO] |     |  +- com.github.jnr:jffi:jar:1.2.15:compile
[INFO] |     |  +- com.github.jnr:jffi:jar:native:1.2.15:runtime
[INFO] |     |  +- org.ow2.asm:asm:jar:5.0.3:compile
[INFO] |     |  +- org.ow2.asm:asm-commons:jar:5.0.3:compile
[INFO] |     |  +- org.ow2.asm:asm-analysis:jar:5.0.3:compile
[INFO] |     |  +- org.ow2.asm:asm-tree:jar:5.0.3:compile
[INFO] |     |  +- org.ow2.asm:asm-util:jar:5.0.3:compile
[INFO] |     |  \- com.github.jnr:jnr-x86asm:jar:1.0.2:compile
[INFO] |     +- com.github.jnr:jnr-constants:jar:0.9.8:compile
[INFO] |     +- com.github.jnr:jnr-enxio:jar:0.16:compile
[INFO] |     \- com.github.jnr:jnr-posix:jar:3.0.35:compile

Many organisations won't be able to use this library at the moment because of that dependency (we currently can't upgrade past v2.5).

deadok22 added a commit to deadok22/java-dogstatsd-client that referenced this issue May 26, 2023
As a workaround for DataDog#85, avoid loading jnr classes
unless they are required. Do not perform
the `instanceof UnixSocketAddress` check for resolvers
that are known not to return UDS addresses.

This change makes it possible for the library consumers that
don't use UDS to exclude jnr-unixsocket and all of its transitive
dependencies from their classpath
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants