Skip to content
This repository has been archived by the owner on Jul 1, 2022. It is now read-only.

Move jaeger-thrift shadow jar to its own classifier #526

Conversation

jpkrohling
Copy link
Collaborator

Signed-off-by: Juraci Paixão Kröhling juraci@kroehling.de

Which problem is this PR solving?

  • By default, libraries usually provide non-shadow JARs, unless explicitly specified via, for instance, Maven classifiers. We thought that providing a shadowed version by default would help most users, but this is getting more complicated that it deserves.
  • Having the shadow by default makes it harder for our users to assess what's running and at which version.

Short description of the changes

Also related: #486, #494 / #498

cc @mdvorak

@ghost ghost assigned jpkrohling Aug 21, 2018
@ghost ghost added the review label Aug 21, 2018
@jpkrohling jpkrohling force-pushed the Revert-Shadow-to-its-own-classifier branch from 05bf33c to bc4b732 Compare August 21, 2018 11:54
@codecov
Copy link

codecov bot commented Aug 21, 2018

Codecov Report

Merging #526 into master will increase coverage by 0.1%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff             @@
##             master     #526     +/-   ##
===========================================
+ Coverage     88.42%   88.52%   +0.1%     
  Complexity      505      505             
===========================================
  Files            66       66             
  Lines          1883     1883             
  Branches        239      239             
===========================================
+ Hits           1665     1667      +2     
+ Misses          142      140      -2     
  Partials         76       76
Impacted Files Coverage Δ Complexity Δ
...egertracing/internal/reporters/RemoteReporter.java 85.71% <0%> (+2.38%) 7% <0%> (ø) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6060f4b...02252d9. Read the comment docs.

@pavolloffay
Copy link
Member

+1.

Could you please briefly summarize what problems shaded jars introduce?

Copy link
Contributor

@objectiser objectiser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - although I would prefer we find out the reason the shadow jar was created in the first place, and whether that use case still exists.

@yurishkuro Do you recall the reason for needing the shaded jar?

README.md Outdated
`jaeger-thrift` module will bring a shaded version of Thrift (and others), making it safe to use your own versions of
such dependencies. A non-shaded version of the dependency is available with the classifier `no-shadow`, but the
transitive dependencies (Thrift included) will have to be added manually to your project.
`jaeger-thrift` module will bring a non-shaded version of Thrift (and others). A non-shaded version of the dependency is
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"A non-shaded version.." - I think that should be "A shaded version..."

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@jpkrohling
Copy link
Collaborator Author

although I would prefer we find out the reason the shadow jar was created in the first place, and whether that use case still exists.

We created the shadow because we were using a very old version of Thrift and conflicted with the version of Thrift people were using. See #228 as one example. For this use case, people can still use the shaded jar.

@jpkrohling jpkrohling force-pushed the Revert-Shadow-to-its-own-classifier branch from bc4b732 to 4b0cc83 Compare August 21, 2018 13:07
@jpkrohling
Copy link
Collaborator Author

Could you please briefly summarize what problems shaded jars introduce?

It's basically what we have in the description: shadow, by definition, hides our dependencies. It bloats the jar and makes security audits harder, for instance.

@pavolloffay
Copy link
Member

shaded by default was added here #460.

@objectiser
Copy link
Contributor

@jpkrohling That is the point - we were using an older version of thrift, which is no longer the case - therefore the reason for having the shaded jar no longer exists.

@yurishkuro
Copy link
Member

The reason is the same, we don't know which version of thrift the end user application is using and thrift versions in Java are highly incompatible even between patches.

TBH the amount of effort we spent on this thrif & shade issue would've been better spent by just writing serialization manually.

@jpkrohling
Copy link
Collaborator Author

@objectiser sorry, I see now what you mean. Looks like it was done as part of #80 (PR #83).

cc @vprithvi

@jpkrohling
Copy link
Collaborator Author

TBH the amount of effort we spent on this thrif & shade issue would've been better spent by just writing serialization manually.

@pavolloffay said the exact same thing to me via IRC, but I don't have the time to do it now. It should be part of #516 though.

That said: is this PR good to be merged? Or should I remove the shadow artifact altogether?

@vprithvi
Copy link
Contributor

For more context around #80: we ran into an issue where span reporting was broken silently when the project overrode the version of thrift to 0.9.3. I'm not sure if that is still an issue.

Because of the prevalence of thrift, I am concerned that removing default shading could cause more problems than it solved. (On the other hand, more experienced users can use a the shade/shadow plugin to relocate the offending classes themselves.)

@jpkrohling
Copy link
Collaborator Author

I am concerned that removing default shading could cause more problems than it solved

By "default shading", did you mean not providing a shaded version at all, or did you mean providing it as the main artifact? Right now, the shaded version is the main artifact for jaeger-thrift and we want to revert that (added recently, as part of #461).

On the other hand, more experienced users can use a the shade/shadow plugin to relocate the offending classes themselves

+1

@objectiser
Copy link
Contributor

That said: is this PR good to be merged? Or should I remove the shadow artifact altogether?

@jpkrohling I'm fine either way, was just looking at an opportunity to simplify.

@jpkrohling jpkrohling force-pushed the Revert-Shadow-to-its-own-classifier branch from 4b0cc83 to 6b0d4c7 Compare August 22, 2018 09:25
Signed-off-by: Juraci Paixão Kröhling <juraci@kroehling.de>
@jpkrohling
Copy link
Collaborator Author

Based on the comments, I understand that this PR looks good, as we don't want to remove the shadow artifact. As such, I'm merging this.

@jpkrohling jpkrohling force-pushed the Revert-Shadow-to-its-own-classifier branch from 6b0d4c7 to 02252d9 Compare August 22, 2018 09:35
@jpkrohling jpkrohling merged commit 02252d9 into jaegertracing:master Aug 22, 2018
@ghost ghost removed the review label Aug 22, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants