LuciferYang commented on code in PR #2772:
URL: https://github.com/apache/uniffle/pull/2772#discussion_r3662365484


##########
client-spark/spark4-shaded/pom.xml:
##########
@@ -37,6 +37,13 @@
       <version>${project.version}</version>
       <!-- use the lz4 from spark env -->
       <exclusions>
+        <!--
+            Must stay org.lz4, do NOT switch to ${lz4.groupId}: Maven matches

Review Comment:
   I tried exactly that and it breaks the shaded client, which is why the 
exclusion has to keep the literal `org.lz4`.
   
   If I switch `common/pom.xml` (and `client-spark/common/pom.xml`) to 
`${lz4.groupId}`, then under `-Pspark4.2` the transitive lz4 enters the graph 
as `at.yawk.lz4:lz4-java`, but `spark4-shaded`'s exclusion matches on the 
**as-declared** coordinate, so `<groupId>org.lz4</groupId>` no longer matches 
and lz4 leaks into the shaded jar:
   
   ```
   unshaded count: 94
   check failed.       # dev/scripts/checkshade.sh, 110 net/jpountz/** classes 
in the jar
   ```
   
   Parameterizing the exclusion too (`<groupId>${lz4.groupId}</groupId>`) 
doesn't save it either — still 94 unshaded and the `checkshade` antrun step 
fails the build. With the current code (literal `org.lz4` in both places) the 
same clean build gives `net/jpountz` count = 0 and `check success.`
   
   There's also no benefit to changing it: the only 1.11-only API is 
`LZ4BlockInputStream.newBuilder()`, and that's called by **Spark's own** 
`LZ4CompressionCodec`, never by Uniffle. Uniffle's `Lz4Codec` only uses 
`LZ4Factory.safeInstance()` / `fastCompressor` / `fastDecompressor` / 
`maxCompressedLength`, all of which exist in 1.8.1 and 1.11.0 alike (the 
`net.jpountz` package name is unchanged by the groupId relocation). And on a 
real cluster the shaded client excludes lz4 and defers to Spark's env lz4 
anyway.
   
   So the split is deliberate: only the modules that must follow Spark's lz4 on 
the **test** classpath (`integration-test/spark-common`, 
`integration-test/spark4`) use `${lz4.groupId}`; `common` / 
`client-spark/common` stay on the pre-relocation coordinate so the shade 
exclusion keeps working. That's what the comment on this line is there to 
prevent someone from "fixing" later. Happy to reword the comment if it reads 
more like a puzzle than a warning.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to