Skip to content

guava_fixes - #251

Open
AbhishekKumar9984 wants to merge 2 commits into
data-integrations:developfrom
AbhishekKumar9984:guava_fixes
Open

AbhishekKumar9984 wants to merge 2 commits into
data-integrations:developfrom
AbhishekKumar9984:guava_fixes

Conversation

@AbhishekKumar9984

@AbhishekKumar9984 AbhishekKumar9984 commented Oct 21, 2026 •

Copy link
Copy Markdown

Depends on: cdapio/cdap#16279

Issue :
Resolved security vulnerabilities (CVE-2023-2976 / CVE-2020-8908) associated with older versions of com.google.guava:guava (13.0.1) and fixed compatibility issues with removed Guava 13 APIs.

Root Cause :
pom.xml depended on com.google.guava:guava version 13.0.1, CDAP/Spark/Netty dependencies transitively pulled in older Guava versions, and StringPartitioner / test classes relied on legacy Guava 13 methods (Hashing.md5().hashString(CharSequence) and AbstractIdleService.startAndWait() / stopAndWait()) removed in newer Guava releases.

Fix :

  • Upgraded com.google.guava:guava from 13.0.1 to 32.0.0-jre via <dependencyManagement> in pom.xml, and added maven-enforcer-plugin (requireUpperBoundDeps).
  • Replaced Hashing.md5().hashString(key.toString()).asInt() with Hashing.md5().hashUnencodedChars(key.toString()).asInt() in StringPartitioner.java and added StringPartitionerTest.
  • Migrated EmbeddedKafkaServer test callers from startAndWait() / stopAndWait() to startAsync().awaitRunning() / stopAsync().awaitTerminated().
  • Updated <cdap.version> to 6.12.0-SNAPSHOT and <hadoop.version> to 3.3.6.

Testing evidence: https://docs.google.com/spreadsheets/d/1Cw6Z_k3wlks7sAC4-Kg6FTIMRL7-zxLlsJIXvVJLrb8/edit?gid=0#gid=0

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request upgrades Guava to version 32.0.0-jre, updates CDAP, Spark, and Hadoop dependencies, and adds numerous Guava exclusions across POM files to prevent dependency conflicts. It also switches to hashUnencodedChars in StringPartitioner and adds startup/shutdown helpers to EmbeddedKafkaServer. Feedback highlights a potential ArrayIndexOutOfBoundsException in StringPartitioner if Math.abs receives Integer.MIN_VALUE, and notes issues in pom.xml where disabling snapshots on sonatype-snapshots conflicts with the use of a CDAP snapshot version, alongside a redundant Apache snapshot repository configuration.

Comment thread pom.xml Resolved
Comment thread pom.xml Resolved

@dheeraj-kholia-cs dheeraj-kholia-cs left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM

fixes3
@deepika-lalwani123 deepika-lalwani123 added the build Trigger unit test build label Oct 28, 2026

@deepika-lalwani123 deepika-lalwani123 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This depends on cdapio/cdap#16279. The currently published 6.12.0-SNAPSHOT still has Guava 13, so this PR cannot be validated or merged until that PR merges and CDAP (and Twill) are published. Please call out the dependency in the PR description.

Comment thread pom.xml Resolved
Comment thread pom.xml Resolved
Comment thread pom.xml Resolved
@AbhishekKumar9984

Copy link
Copy Markdown
Author

@deepika-lalwani123 Updated the PR description to call out the dependency on cdapio/cdap#16279, and addressed all inline review comments.

…cer rule, add StringPartitionerTest, and remove startAndWait/stopAndWait shims
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build Trigger unit test build

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants