Repository navigation
Bump quartz to 2.3.2 and remove the dropped setRunUpdateCheck call - #16308
deepika-lalwani123 wants to merge 7 commits into
Conversation
There was a problem hiding this comment.
Code Review
This pull request performs a comprehensive update of project dependencies and versions in the root pom.xml and various sub-modules, including upgrades to libraries like Gson, Netty, Jetty, and Quartz. It also cleans up redundant dependency version definitions in sub-modules by leveraging the root pom's dependency management. I have reviewed the comments and identified several opportunities to further simplify the pom files by removing redundant version tags where dependency management is already in place.
| <!-- Needs to define the gson and guava versions to override the one from dependency management in cdap pom.xml --> | ||
| <gson.version>2.8.6</gson.version> | ||
| <gson.version>2.8.9</gson.version> |
| <!-- Needs to define the gson and guava versions to override the one from dependency management in cdap pom.xml --> | ||
| <gson.version>2.8.6</gson.version> | ||
| <gson.version>2.8.9</gson.version> | ||
| <guava.version>25.1-jre</guava.version> |
There was a problem hiding this comment.
Since gson.version is now managed as 2.8.9 in the root pom.xml, the local override is redundant. We can remove the gson.version property and update the comment to only reference the guava version override.
| <!-- Needs to define the gson and guava versions to override the one from dependency management in cdap pom.xml --> | |
| <gson.version>2.8.6</gson.version> | |
| <gson.version>2.8.9</gson.version> | |
| <guava.version>25.1-jre</guava.version> | |
| <!-- Needs to define the guava version to override the one from dependency management in cdap pom.xml --> | |
| <guava.version>25.1-jre</guava.version> |
| <dependency> | ||
| <groupId>ch.qos.logback</groupId> | ||
| <artifactId>logback-classic</artifactId> | ||
| <version>1.2.8</version> | ||
| <version>${logback.version}</version> | ||
| <scope>runtime</scope> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>ch.qos.logback</groupId> | ||
| <artifactId>logback-core</artifactId> | ||
| <version>1.2.8</version> | ||
| <version>${logback.version}</version> | ||
| <scope>runtime</scope> | ||
| </dependency> |
There was a problem hiding this comment.
Since logback-classic and logback-core are managed in the root pom.xml's <dependencyManagement>, specifying the <version> tag here is redundant. We can safely remove the <version> tags to simplify dependency management.
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-core</artifactId>
<scope>runtime</scope>
</dependency>
| <dependency> | ||
| <groupId>org.apache.httpcomponents</groupId> | ||
| <artifactId>httpclient</artifactId> | ||
| <version>4.5.2</version> | ||
| <version>${httpclient.version}</version> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>org.apache.httpcomponents</groupId> | ||
| <artifactId>httpcore</artifactId> | ||
| <version>4.4.4</version> | ||
| <version>${httpcore.version}</version> | ||
| <scope>compile</scope> | ||
| </dependency> |
There was a problem hiding this comment.
Since httpclient and httpcore are now managed in the root pom.xml's <dependencyManagement>, we can remove the redundant <version> tags from these dependencies.
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcore</artifactId>
<scope>compile</scope>
</dependency>
| <dependency> | ||
| <groupId>org.apache.httpcomponents</groupId> | ||
| <artifactId>httpclient</artifactId> | ||
| <version>4.5.2</version> | ||
| <version>${httpclient.version}</version> | ||
| </dependency> |
| <dependency> | ||
| <groupId>org.apache.httpcomponents</groupId> | ||
| <artifactId>httpcore</artifactId> | ||
| <version>4.4.4</version> | ||
| <version>${httpcore.version}</version> | ||
| <scope>compile</scope> | ||
| </dependency> |
There was a problem hiding this comment.
cdap-data-streams3_2.12 was the only system-artifact module still on maven-bundle-plugin 3.3.0. cdap-data-pipeline3_2.12, cdap-etl-batch and cdap-program-report already use 3.5.0. The bnd in 3.3.0 can't parse the root-level module-info.class shipped in gson 2.8.9 and jackson-annotations 2.18.12 (the CVE bumps in this stack). Packaging fails with "Invalid class file module-info.class (java.lang.ArrayIndexOutOfBoundsException: 19)", and cdap-master -Pdist can't produce the data-streams system artifact. 3.5.0 handles it. Checked locally (JDK 8): - On develop, the data-streams bundle built with 3.3.0 and with 3.5.0 is the same: same 28 embedded jars, same Export-Package and Import-Package, same Require-Capability. - On this stack, packaging fails with 3.3.0 and succeeds with 3.5.0. The only bundle differences from develop are the intended version bumps (gson 2.8.9, logback 1.2.13). maven-bundle-plugin 5.1.9 was also tried. It builds, but changes what gets embedded: 11 to 17 extra jars per bundle, including cdap-api-common, cdap-runtime-spi, scala-library, jetty 9.4.51 and jackson 2.15.1. So it was not used here.
Root pom.xml: - jgit 5.9.0.202009080501-r -> 5.13.5.202508271544-r (stays on 5.x; 6.x needs Java 11). 5.13.4.202507202350-r fixes the same CVEs but was built on JDK 17 without --release 8: it calls the Java 9+ ByteBuffer.mark() overload and fails on Java 8 with NoSuchMethodError (all RepositoryManagerTest cases fail). 5.13.5 is the 5.13.4 fix release for this. - gson.version 2.3.1 -> 2.8.9. - log4j2.slf4j.version (log4j-to-slf4j / log4j-api) 2.20.0 -> 2.25.5. - commons-lang3 3.12.0 -> 3.18.0 (must precede commons-configuration2 2.15.0 in CL-07). cdap-master/pom.xml: remove the commons-io 2.12.0 override in the k8s profile so master/lib uses the managed commons-io 2.15.1. The quartz 2.3.2 bump needs a code change, so it is in the next commit (vuln/cl-09b-code) together with that change; every commit builds. Why: CVE fixes from image scanning of gcr.io/cdapio/cdap. Closes jgit b/578567823 (High) and b/578495338 (Medium). Platform side of log4j-api b/578584043 and commons-io b/578659719. Risk: low to medium. gson is used in many modules and is visible to plugins. Testing: JDK 8, Checkstyle on: cdap-source-control (all tests), cdap-proto (all tests), cdap-common LocationsTest, cdap-app-fabric compile and TimeSchedulerTest; mvn dependency:tree for the bumped artifacts.
Versions: - jackson.version 2.15.1 -> 2.18.12 (jackson-core, jackson-databind, jackson-annotations, jackson-dataformat-cbor, jackson-module-scala_2.12) - jackson-jaxrs-json-provider, jackson-jaxrs-base and jackson-module-jaxb-annotations 2.12.7 -> 2.18.12. These come from hadoop-yarn-common and were not managed; importing com.fasterxml.jackson:jackson-bom after the explicit entries aligns them with databind. Why: image scanning of gcr.io/cdapio/cdap reports Jackson CVEs. 2.18.12 is the minimum version that fixes all of them and runs on Java 8. Bugs: closes b/578521062 and b/578660123; part of the shared Jackson bug set (with CL-04 and CL-10). Merge gate (paired with the SnakeYAML 2.0 commit stacked directly on this one): this commit moves jackson-dataformat-yaml in master/lib (from elasticsearch-x-content) from 2.8.11 to 2.18.12. 2.18.12 needs SnakeYAML 1.33 or later, and master/lib has 1.17 until the next commit; the old 2.8.11 does not work with SnakeYAML 2.0. So the two commits must merge in the same push (one PR with two commits), also on release/6.11. Risk: medium-low. CDAP src/main does not import Jackson (CDAP uses Gson). Users are libraries: AWS SDK (emr), avro (program-report), Hadoop YARN, google-cloud-storage (dataproc), google-http-client (cloudkms). Spark programs keep using Spark's own Jackson. Testing (JDK 8, Checkstyle on): cdap-runtime-ext-emr, cdap-runtime-ext-dataproc, cdap-securestore-ext-cloudkms mvn package pass; ReportGenerationAppTest, cdap-spark-core3_2.12 (43 tests), DataPipelineTest Spark methods on cdap-data-pipeline3_2.12 and Spark2Test on cdap-unit-test-spark3_2.12 pass, except testPySpark, which fails because the local Python 3.13 cannot import pyspark 3.3 (typing.io was removed); unrelated to Jackson. dependency:tree shows every com.fasterxml.jackson artifact at 2.18.12.
- cdap-kubernetes, cdap-credential-ext-gcp-wi: k8s.version (client-java, client-java-api-fluent) 16.0.2 -> 17.0.2, and declare org.yaml:snakeyaml directly. - Root pom.xml: new snakeyaml.version 2.0, managed in dependencyManagement, so every module (including master/lib, where SnakeYAML also arrives through elasticsearch-x-content) resolves to exactly 2.0 instead of depending on Maven nearest-wins mediation. SnakeYAML cannot move to 2.x alone: client-java 16 uses the SafeConstructor/Constructor APIs removed in SnakeYAML 2. client-java 17 is built for SnakeYAML 2.0. No CDAP source change is needed (CDAP does not use SnakeYAML directly; both modules compile unchanged). Why: CVE-2022-1471 (Critical) in SnakeYAML 1.33 from image scanning of gcr.io/cdapio/cdap. Closes b/578585839. Risk: medium. - client-java 17 is built on gson 2.10 and okhttp 4.10; these modules keep their gson 2.8.9 and okhttp 4.9.1 pins (KubeMasterEnvironmentTest and the module tests pass). - master/lib gets jackson-dataformat-yaml through elasticsearch-x-content 6.5.3. Its own 2.8.11 calls SnakeYAML 1.x APIs that 2.0 removed (ParserImpl(StreamReader) and others). The Jackson 2.18.12 commit directly below this one already moves it to 2.18.12, which works with SnakeYAML 2.0. Merge gate: the two commits must merge in the same push (2.18.12 alone does not work with the SnakeYAML 1.17 that master/lib has before this commit), also on release/6.11. Testing (JDK 1.8.0_382, Checkstyle 0 violations): - cdap-kubernetes: mvn package -Pdist, 73 tests, 0 failures (5 skipped), including KubeMasterEnvironmentTest. - cdap-credential-ext-gcp-wi: mvn package -Pdist, 3/3 tests. - cdap-elastic: test-compile. - target/libexec of both modules: client-java* 17.0.2, snakeyaml 2.0. - dependency:tree -Dincludes=org.yaml: snakeyaml 2.0 in cdap-kubernetes, gcp-wi, cdap-elastic, cdap-app-fabric, cdap-standalone and cdap-master -Pdist,k8s.
… commons-text Hadoop 3.3.6 (hadoop-common, hadoop-auth, hadoop-yarn-client) pulls these jars into master/lib, ui/lib and the extensions. Image scanning of gcr.io/cdapio/cdap reports CVEs in all of them. Pin each one in the root dependencyManagement: - org.codehaus.jettison:jettison 1.1 -> 1.5.4 - com.nimbusds:nimbus-jose-jwt 9.8.1 -> 9.37.4 (also drops json-smart, which 9.37.x shades) - commons-beanutils:commons-beanutils 1.9.4 -> 1.11.0 - org.apache.commons:commons-configuration2 2.10.1 -> 2.15.0 - org.apache.commons:commons-text 1.10.0 -> 1.15.0 - commons-io:commons-io 2.15.1 -> 2.17.0 (needed by configuration2 2.15.0) Why commons-io moves: configuration2 2.15.0 builds its file location strategies on org.apache.commons.io.build.AbstractSupplier and calls IOSupplier.getUnchecked(), which commons-io adds in 2.17.0. With commons-io 2.15.1, Hadoop's MetricsConfig (MiniDFSCluster, MetricsSystem) fails with NoSuchMethodError in FileLocatorUtils.<clinit>; UGIProviderTest catches it. 2.17.0 is the lowest commons-io that works and still runs on Java 8. The other commons-io APIs that configuration2 uses (IOUtils.closeQuietly(Closeable, Consumer), AbstractSupplier) are already in 2.17.0. commons-lang3 stays at 3.18.0 (from the jgit/gson/log4j2/commons-lang3 commit). Bugs: b/578523779 (commons-configuration2, CVE-2026-45205), plus the jettison, nimbus-jose-jwt / json-smart and commons-beanutils image-scanning bugs (b/578572706 for beanutils). Some of these also need the cdap-etl-tools removal and the events-writer checkstyle-dependency removal. Risk: low. CDAP src/main does not import any of these packages; only Hadoop uses them. commons-beanutils-core 1.8.3 (via netty-http) is a different artifact and is not changed here. Testing (JDK 1.8.0_382, Checkstyle 0 violations): - cdap-common: mvn package, 321 tests, 0 failures, 2 skipped (incl. LocationsTest). - cdap-security: mvn package, 125 tests, 0 failures (incl. UGIProviderTest with MiniDFSCluster). - cdap-app-fabric: LocalizationUtilsTest, DefaultUGIProviderTest, DefaultSecureStoreServiceTest, 10 tests, 0 failures. - dependency:tree for cdap-common, cdap-security, cdap-app-fabric and cdap-master -Pdist,k8s shows the pinned versions; json-smart is gone. - Still to run: S1 on Dataproc, S4 with security on, S5.
Versions: - cdap-kubernetes, cdap-credential-ext-gcp-wi: protobuf-java 3.21.10 -> 3.25.5 (pulled in by K8s client-java 17.0.2) - cdap-securestore-ext-gcp-secretstore: protobuf-java and protobuf-java-util 3.21.12 -> 3.25.5 (pulled in by google-cloud-secretmanager 2.8.0; -util is kept on the same version as the runtime) Why: image scanning of gcr.io/cdapio/cdap reports protobuf-java CVEs for the jars in ext/environments/k8s, ext/credentialproviders and ext/securestores. 3.25.5 is the minimum version that fixes them and runs on Java 8. The pins are per module only. A root pin would downgrade the Dataproc provisioner (4.33.6) and the Spanner extensions (4.29.0) and break them at runtime. Bugs: the protobuf bug set for the Platform image (CL-11, together with CL-01, CL-04 and the metrics-writer CL-11b). Risk: low-medium. Minor runtime jump within 3.x; CDAP code only uses runtime types (ByteString, FieldMask, Duration, Timestamps). Testing (JDK 8, Checkstyle on): mvn package on cdap-kubernetes (73 tests, 5 skipped), cdap-credential-ext-gcp-wi (3), and cdap-securestore-ext-gcp-secretstore (23) passes. Regression: cdap-runtime-ext-dataproc (85), cdap-storage-ext-spanner (19, 2 skipped) and cdap-messaging-ext-spanner (7, 1 skipped) pass and dependency:tree shows they stay on protobuf 4.33.6 / 4.29.0.
c01d38c to
fb3f4d2
Compare
Root pom.xml: quartz / quartz-jobs 2.2.0 -> 2.3.2. Quartz 2.3 moved its pool dependencies to com.mchange, so the c3p0:c3p0 exclusion becomes com.mchange:c3p0, com.mchange:mchange-commons-java and com.zaxxer:HikariCP-java7 (CDAP uses its own RAMJobStore-based store). AppFabricServiceRuntimeModule: quartz 2.3 deleted its update checker and with it QuartzSchedulerResources.setRunUpdateCheck(boolean), so remove the qrs.setRunUpdateCheck(false) call and the matching javadoc phrase. CDAP already set the flag to false and quartz 2.3.2 has no UpdateChecker class, so behavior does not change. The bump and the code change are in one commit so that every commit compiles. Why: CVE fix from image scanning of gcr.io/cdapio/cdap. Closes quartz b/578446847 (Critical, CVE-2019-13990). Risk: low. Scheduler code path only. Testing: JDK 8, Checkstyle on: cdap-app-fabric TimeSchedulerTest, DatasetBasedTimeScheduleStoreTest, CoreSchedulerServiceTest, LocalizationUtilsTest (22/22); mvn dependency:tree shows quartz 2.3.2 with no c3p0 / mchange. Also update TriggerCodecTest: quartz 2.3 fixed the "specfied" typo in the "'?' can only be specified for Day-of-Month -OR- Day-of-Week." message, so the test now matches the stable part of the message. Cron validation itself is unchanged (TriggerCodecTest 3/3, TimeSchedulerTest 2/2 pass on JDK 8).
fb3f4d2 to
3069b01
Compare
| <properties> | ||
| <guava.version>31.1-jre</guava.version> | ||
| <k8s.version>16.0.2</k8s.version> | ||
| <k8s.version>17.0.2</k8s.version> |
There was a problem hiding this comment.
Can 28.0.0.
1.17.x version is incompatible with supported k8s versions.
https://github.com/kubernetes-client/java/wiki/2.-Versioning-and-Compatibility
|
|
||
| <properties> | ||
| <k8s.version>16.0.2</k8s.version> | ||
| <k8s.version>17.0.2</k8s.version> |
There was a problem hiding this comment.
Can 28.0.0.
1.17.x version is incompatible with supported k8s versions.
https://github.com/kubernetes-client/java/wiki/2.-Versioning-and-Compatibility
| <junit.version>4.11</junit.version> | ||
| <hamcrest.version>2.2</hamcrest.version> | ||
| <log4j2.slf4j.version>2.20.0</log4j2.slf4j.version> | ||
| <log4j2.slf4j.version>2.25.5</log4j2.slf4j.version> |
There was a problem hiding this comment.
Can 2.26.1 be used instead as it have additional vuln fixes?
|



Bump quartz to 2.3.2 and remove the dropped setRunUpdateCheck call
Repo: cdapio/cdap
Base: develop (stacked)
Commit: c01d38c
Title
Bump quartz to 2.3.2 and remove the dropped setRunUpdateCheck call
Description
Root
pom.xml: quartz / quartz-jobs 2.2.0 → 2.3.2. Quartz 2.3 moved itspool dependencies to
com.mchange, so thec3p0:c3p0exclusion is replacedby three:
com.mchange:c3p0,com.mchange:mchange-commons-java, andcom.zaxxer:HikariCP-java7. CDAP uses its own job store, based on RAMJobStore.AppFabricServiceRuntimeModule: quartz 2.3 deleted its update checker, andwith it
QuartzSchedulerResources.setRunUpdateCheck(boolean). With quartz2.3.2 the call does not compile:
This PR removes the call and the matching javadoc phrase. Behavior does not
change: CDAP already set the flag to false, and quartz 2.3.2 has no
UpdateCheckerclass. The version bump and the code change are in one commitso every commit in the stack compiles.
Why: CVE-2019-13990 (Critical), found by image scanning of
gcr.io/cdapio/cdap.
Risk: low. Scheduler code path only.
Testing (JDK 1.8.0_382, Checkstyle 0 violations):
CoreSchedulerServiceTest, LocalizationUtilsTest: 22/22 pass.
dependency:tree: quartz and quartz-jobs 2.3.2 with no c3p0 / mchange incompile/runtime scope.