fix: pin Netty to the gRPC-supported version in Spring modules#1793
fix: pin Netty to the gRPC-supported version in Spring modules#1793javier-aliaga wants to merge 1 commit into
Conversation
Signed-off-by: Javier Aliaga <javier@diagrid.io>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1793 +/- ##
=========================================
Coverage 76.85% 76.85%
Complexity 2300 2300
=========================================
Files 244 244
Lines 7145 7145
Branches 748 748
=========================================
Hits 5491 5491
Misses 1288 1288
Partials 366 366 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
| @@ -35,6 +35,15 @@ | |||
| <dependencies> | |||
| <!-- Import the Spring Boot 4 BOM so JUnit (jupiter + platform) resolves consistently to 6.x, | |||
| matching the spring-boot-sdk-tests module and the Spring Boot 4 starter pulled in here. --> | |||
| <!-- Pin Netty to the gRPC-supported 4.1.x line (root netty.version); MUST precede the Spring Boot | |||
| BOM, which manages Netty 4.2.x - unsupported by the non-shaded grpc-netty this SDK uses. --> | |||
| <dependency> | |||
There was a problem hiding this comment.
@javier-aliaga I think we should do this in the parent pom. And just import it here. That way all the versions are in one single place.
Applies to changes in all other poms as well
There was a problem hiding this comment.
I tried moving it to parent but then it resolves to 4.2.x instead of 4.1.x, I did a research and it seems as we import the spring-boot-dependencies it wins over the parent import, that is why we need it in every pom. To make it to the parent it would require a bigger refactor...
Description
The Spring Boot 4 migration (#1772) has the Dapr Spring modules import the Spring Boot 4 BOM, which manages Netty 4.2.x. The SDK uses the non-shaded
grpc-netty(1.79.0), and per gRPC's compatibility matrix gRPC 1.79 targets Netty 4.1.x — no gRPC release supports Netty 4.2.x. Inside these modulesgrpc-nettyis acompile-scope transitive (viadapr-sdk), so it was resolving onto an unsupported Netty line.The concrete impact is on the SDK's own reactor: it was building and — more importantly — running its Spring integration tests and examples against a Netty version gRPC does not support (
sdk-tests/spring-boot-sdk-testsexercise real gRPC over a Testcontainersdaprd). In other words, "CI green" was validating gRPC on Netty 4.2.x, an untested combination that can fail withNoSuchMethodError/NoClassDefFoundError.Scope note: downstream apps that import
dapr-spring-bomare already protected — it pins Netty4.1.132transitively viadapr-sdk-bom. This change does not alter that; it aligns the SDK's own builds, tests, and examples with the same supported Netty version the core modules already use. The rootpom.xmlpinsnetty-bom4.1.132, but the Spring modules override it by importing the Spring Boot BOM in their owndependencyManagement, so the pin never reached them.Switching to
grpc-netty-shadedis not an option — it was deliberately removed in #1543 because shaded Netty breaks native compilation (Quarkus / Spring Native), prevents patching Netty CVEs, and increases memory usage.Fix
Import
netty-bom(${netty.version}=4.1.132) beforespring-boot-dependenciesin the gRPC-reachable Spring modules, so Maven's first-declared-wins rule keeps Netty on the gRPC-supported 4.1.x line:dapr-spring-boot-autoconfiguredapr-spring-datadapr-spring-boot-startersdk-testsspring-boot-examplesspring-boot-sdk-testsdapr-spring-boot-starter-testpulls no Netty transitively, so it is intentionally left unpinned.Verification
Resolved
io.netty:netty-commonviadependency:treein each affected module — all now resolve4.1.132.Final(previously4.2.12.Final), matching the version already used by the core SDK.Checklist