-
Notifications
You must be signed in to change notification settings - Fork 102
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
Allow jnr-unixsocket version to be overridden or excluded by downstream dependenencies #182
Conversation
Shuffle the code in the builder so that we don't load unix socket support classes unless the client is configured to use unix sockets. Use reflection in the client to test if the address is a UnixSocketAddress. This allows the client code to function at runtime in UDP mode without having jnr-unixsocket artifacts on the classpath.
Skip UDS tests if jnr-unixsocket classes are not available at runtime.
Add new profiles to test two additional configurations related to jnr-unixsocket: - with jnr-unixsocket not available at runtime - with newer version of jnr-unixsocket (either compile or runtime)
Add two new jobs that simulate different configurations at runtime: - no jnr-unixsocket package available at all; - latest version is supplied instead of the one we depend on; Compilation is done using the default version in all jobs.
Windows failure is caused by an unrelated concurrent modification issue, which will be fixed by #183 |
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.
Code looks good to me, but can you please triple-check jnr-unixsocket
version v0.38.15
is java7 compatible?
<dependency> | ||
<groupId>com.github.jnr</groupId> | ||
<artifactId>jnr-unixsocket</artifactId> | ||
<version>0.38.15</version> |
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 believe this version is not java7 compatible and per: eed7a1c, it appears to be the case. Let's check.
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.
It isn't, and we still depend on 0.36. This bit is in a profile that is only activated for testing. The idea is to validate the library using both 0.36 and 0.38.15, so we can provide a bit of assurance for users that don't need Java 7 compatibility and would like a later version.
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.
Gotcha!
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.
📦
<dependency> | ||
<groupId>com.github.jnr</groupId> | ||
<artifactId>jnr-unixsocket</artifactId> | ||
<version>0.38.15</version> |
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.
Gotcha!
With refactor from fb4cd25 the amount of changes necessary to make jnr-unixsocket optional at runtime is fairly small, and we don't need to rely on reflection at all.
Rest of the PR is adding tests for this scenario. UDS-related tests are adjusted to skip if UDS is not available at runtime; but everything else should run as before. A new maven profile is added that drops jnr-unixsocket from classpath only when running tests. This would be similar to how things are for our library if downstream excludes jnr-unixsocket dependency.
Latest jnr-unixsocket version, 0.38.15, appears to be backwards compatible, and can be used in-place of 0.36 which we depend on currently. To help users that want to use later version, run the test suite against a newer version as well.
Lastly, this adds two new CI jobs to run the above.