[INFRAUTILS-41] Bump dropwizard.metrics from 3.2.5 to 4.0.2 Created: 24/May/18 Updated: 04/Sep/18 Resolved: 04/Sep/18 |
|
| Status: | Resolved |
| Project: | infrautils |
| Component/s: | metrics |
| Affects Version/s: | None |
| Fix Version/s: | Fluorine |
| Type: | Improvement | Priority: | Medium |
| Reporter: | Michael Vorburger | Assignee: | Michael Vorburger |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||
| Description |
|
Bump io.dropwizard.metrics : metrics-core & Co. from old 3.2.5 to latest current non-RC release 4.0.2. https://git.opendaylight.org/gerrit/#/c/72223/ is hitting an interesting OSGi problem: Running org.opendaylight.odlparent.featuretest.SingleFeatureTest Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 14.316 sec <<< FAILURE! - in org.opendaylight.odlparent.featuretest.SingleFeatureTest installFeatureCatchAndLog(org.opendaylight.odlparent.featuretest.SingleFeatureTest)[repoUrl: file:/home/vorburger/dev/ODL/git/infrautils/common/features/odl-infrautils-metrics/target/feature/feature.xml, Feature: odl-infrautils-metrics 1.4.0.SNAPSHOT] Time elapsed: 14.04 sec <<< ERROR! org.osgi.service.resolver.ResolutionException: Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=odl-infrautils-metrics; type=karaf.feature; version="[1.4.0.SNAPSHOT,1.4.0.SNAPSHOT]"; filter:="(&(osgi.identity=odl-infrautils-metrics)(type=karaf.feature)(version>=1.4.0.SNAPSHOT)(version<=1.4.0.SNAPSHOT))" [caused by: Unable to resolve odl-infrautils-metrics/1.4.0.SNAPSHOT: missing requirement [odl-infrautils-metrics/1.4.0.SNAPSHOT] osgi.identity; osgi.identity=org.opendaylight.infrautils.metrics-impl; type=osgi.bundle; version="[1.4.0.SNAPSHOT,1.4.0.SNAPSHOT]"; resolution:=mandatory [caused by: Unable to resolve org.opendaylight.infrautils.metrics-impl/1.4.0.SNAPSHOT: missing requirement [org.opendaylight.infrautils.metrics-impl/1.4.0.SNAPSHOT] osgi.wiring.package; filter:="(&(osgi.wiring.package=com.codahale.metrics.jvm)(version>=4.0.0)(!(version>=5.0.0)))" [caused by: Unable to resolve io.dropwizard.metrics.jvm/4.0.2: missing requirement [io.dropwizard.metrics.jvm/4.0.2] osgi.wiring.package; filter:="(osgi.wiring.package=com.sun.management)"]]] This com.sun.management package seems to be officially documented (and I guess part of OpenJDK as well, not just Oracle's distro). In the MANIFEST.MF of ~/.m2/repository/io/dropwizard/metrics/metrics-jvm/4.0.2/metrics-jvm-4.0.2.jar there is: Import-Package: org.slf4j;version="[1.6.0,2.0.0)",com.codahale.metrics ;version="[4.0,5)",com.sun.management,javax.management Export-Package: com.codahale.metrics.jvm;uses:="com.codahale.metrics,javax.management";version="4.0.2" |
| Comments |
| Comment by Michael Vorburger [ 24/May/18 ] |
|
> This com.sun.management package ... but it's probably not exposed as an Export-Package by .. "the JDK" - but where is that defined? skitt tpantelis rovarga any suggestion how to best and "correctly" address this where? |
| Comment by Tom Pantelis [ 24/May/18 ] |
|
You can add it to the etc/jre.properties. |
| Comment by Michael Vorburger [ 24/May/18 ] |
|
> You can add it to the etc/jre.properties. tpantelis OMG, yes that works - you're the man! Therefore so proposed in https://git.opendaylight.org/gerrit/#/c/72236/ ... I've locally verified that c/72223 passes IFF one grabs c/72236, does an mvn install of odlparent/karaf (NOT just odlparent/karaf/opendaylight-karaf-resources) AND bumps infrautils/common/features/odl-infrautils-metrics from 3.1.0 to 3.1.2-SNAPSHOT. skitt any chance will you cut a 3.1.2 some time? |
| Comment by Tom Pantelis [ 24/May/18 ] |
|
Are we sure we want to add com.sun.management? Relying on com.sun.anything is risky. Does dropwizard actually need it and why.... |
| Comment by Michael Vorburger [ 24/May/18 ] |
|
In general com.sun.* is certainly bad, but given that this com.sun.management package seems to be officially documented (and I guess part of OpenJDK as well, not just Oracle's distro), I'd argue that this seems to be a valid exception to the general rule. I've not dug into the details of what Dropwizard Metrics does with com.sun.management, but that doc gives us a good clue - that stuff all seems useful for exposing to monitoring tools, and not too nefarious. |
| Comment by Michael Vorburger [ 30/May/18 ] |
|
We briefly discused this during the Kernel Projects sync call yesterday: rovarga would really like this package to only be an optional import of Dropwizard Metrics. I'll propose that there. skitt seemed to not be against / be OK with c/72236, based on above (I think).
|
| Comment by Stephen Kitt [ 30/May/18 ] |
|
Yes, c/72236 only makes the package available (if it’s there), it doesn’t tie our distribution to its availability, AFAICT. The main problem is really Metrics’ dependency on it. |
| Comment by Michael Vorburger [ 30/May/18 ] |
| Comment by Michael Vorburger [ 04/Sep/18 ] |
|
skitt do you remember if there was anything left to do here? https://github.com/dropwizard/metrics/pull/1317 went in over there, and we'll pick it up in |