fix(build): declare lombok in annotationProcessorPaths to deflake parallel-build compilation#19020
Open
wombatu-kun wants to merge 1 commit into
Open
Conversation
…allel-build compilation Parallel reactor builds (mvn -T) intermittently fail testCompile with "Provider lombok... could not be instantiated" because the processor is discovered from the shared compile classpath via ServiceLoader. Declaring lombok explicitly in the compiler plugin's annotationProcessorPaths gives each compilation an isolated processor path, removing the race. Lombok is the only annotation processor with work in the build, so no other processing is affected.
Collaborator
hudi-agent
reviewed
Jun 16, 2026
hudi-agent
left a comment
Contributor
There was a problem hiding this comment.
🤖 This review was generated by an AI agent and may contain mistakes. Please verify any suggestions before applying.
Thanks for the contribution! This PR declares Lombok explicitly in annotationProcessorPaths in the parent maven-compiler-plugin config to fix a flaky ServiceLoader race during parallel reactor builds. No issues flagged from this automated pass — a Hudi committer or PMC member can take it from here for a final review.
cc @yihua
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Describe the issue this Pull Request addresses
The parallel reactor build (
mvn clean install -T 2) intermittently fails a module'stestCompilewith:This is a flaky
ServiceLoaderrace: the Lombok annotation processor is discovered from the shared compile classpath'sMETA-INF/servicesfile, and under a parallel (-T) build running in a single JVM that discovery/instantiation intermittently fails. It is unrelated to the code under test (it surfaced onhudi-cliwhilehudi-kafka-connectbuilt fine). Seen in thetest-common-and-other-modulesjob: https://github.com/apache/hudi/actions/runs/27601324605/job/81602759051Summary and Changelog
Declare the annotation processor path explicitly in the parent
maven-compiler-pluginconfiguration (<annotationProcessorPaths>withorg.projectlombok:lombok:${lombok.version}) instead of relying on classpath service discovery. An explicit processor path gives each compilation a dedicated, isolated processor classloader, which removes the discovery race and also stops the compiler from scanning the whole compile classpath for processor service files.Lombok is the only annotation processor that has any work in this build, verified by inspection: no
@AutoService, Immutables, MapStruct, or log4j@Pluginannotations exist in the source and there are no customMETA-INF/services/javax.annotation.processing.Processorfiles, so isolating Lombok does not disable any meaningful processing.The configuration lives in the parent
<pluginManagement>, so it applies to every module. The four modules that override the compiler<configuration>(hudi-common,hudi-hadoop-common,hudi-hadoop-mr,hudi-io, all only to target Java 8) still inheritannotationProcessorPathsthrough Maven's per-element configuration merge. This was verified withmvn help:effective-pom: their effectivetestCompileconfiguration contains both<release>8</release>and the lombokannotationProcessorPaths. No module declares its ownannotationProcessorPaths, so coverage is global with this single change.Impact
Build/CI reliability only; no product code, API, or behavior change. Reduces flaky
testCompilefailures caused by the processor-instantiation race under parallel builds, across all modules. Lombok processing itself is unchanged, verified by compiling a@Slf4jmodule (hudi-kafka-connect) cleanly under the new configuration.Risk Level
low
Lombok is the only annotation processor with work in the repo, so making the processor path explicit is behavior-preserving for compilation, and
effective-pomconfirms every module (including the Java 8 ones that override the compiler config) keeps the processor path. Verified that a Lombok-using module compiles cleanly under the change. The flake is environmental and not locally reproducible, so this is the standard, recommended mitigation for the symptom rather than a locally-proven elimination.Documentation Update
none
Contributor's checklist