You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "RongtongJin (via GitHub)" <gi...@apache.org> on 2026/08/13 15:47:12 UTC
[I] [Bug] fastjson2 2.0.63 fails on JDK 8 cold start with LambdaConversionException [rocketmq]
RongtongJin opened a new issue, #10927:
URL: https://github.com/apache/rocketmq/issues/10927
### Before Creating the Bug Report
- [x] I found a bug, not just a question.
- [x] I searched RocketMQ issues, pull requests, and discussions and found no duplicate.
- [x] I confirmed that the affected dependency is used by this repository.
### Runtime platform environment
- OS: macOS arm64
- Build tool: Maven 3.9.2
### RocketMQ version
- Branch: `develop`
- Commit: `7eee0fc366e869cbfe92b5c763f1a7daafc91af9`
- fastjson2: `2.0.63`
### JDK Version
Amazon Corretto `1.8.0_502-b07`.
### Describe the Bug
RocketMQ `develop` currently uses fastjson2 2.0.63 after #10715. In a fresh JDK 8 process, remoting serialization can fail while fastjson2 creates a property accessor:
```text
RuntimeException: Failed to create lambda for method:
public void org.apache.rocketmq.remoting.protocol.body.BatchAck.setTopic(java.lang.String)
Caused by: java.lang.invoke.LambdaConversionException:
Invalid caller: org.apache.rocketmq.remoting.protocol.body.BatchAck
```
The result depends on whether `MethodHandles.Lookup` was initialized before fastjson2, so broader test execution or application initialization order may mask the problem.
### Steps to Reproduce
Use JDK 8 and run the remoting compatibility test in a fresh JVM:
```bash
mvn -B -ntp -nsu -pl remoting -am \
-Djacoco.skip=true \
-Dtest=RemotingSerializableCompatTest \
-Dsurefire.failIfNoSpecifiedTests=false \
clean test
```
With fastjson2 2.0.63:
```text
Tests run: 2, Failures: 0, Errors: 1, Skipped: 1
BUILD FAILURE
```
Override only the fastjson2 version:
```bash
mvn -B -ntp -nsu -pl remoting -am \
-Dfastjson2.version=2.0.64 \
-Djacoco.skip=true \
-Dtest=RemotingSerializableCompatTest \
-Dsurefire.failIfNoSpecifiedTests=false \
clean test
```
Result:
```text
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0
BUILD SUCCESS
```
### What Did You Expect to See?
RocketMQ remoting objects should serialize and deserialize normally on the supported JDK 8 runtime.
### What Did You See Instead?
fastjson2 2.0.63 throws `LambdaConversionException: Invalid caller` during property accessor creation.
### Additional Context
This JDK 8 cold-start regression is fixed upstream in fastjson2 2.0.64:
- https://github.com/alibaba/fastjson2/issues/7691
- https://github.com/alibaba/fastjson2/pull/7718
- https://github.com/alibaba/fastjson2/releases/tag/2.0.64
The proposed RocketMQ fix is to upgrade Maven and Bazel to fastjson2 2.0.64 without adding an initialization-order workaround.
--
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: commits-unsubscribe@rocketmq.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Bug] fastjson2 2.0.63 fails on JDK 8 cold start with LambdaConversionException [rocketmq]
Posted by "RockteMQ-AI (via GitHub)" <gi...@apache.org>.
RockteMQ-AI commented on issue #10927:
URL: https://github.com/apache/rocketmq/issues/10927#issuecomment-5283070715
**Issue Evaluation**
Category: `type/bug` | Status: **Confirmed**
The reported issue has been verified against the current codebase.
**Root Cause:** fastjson2 2.0.63 has a JDK 8 cold-start regression where `MethodHandles.Lookup` initialization order causes `LambdaConversionException: Invalid caller` during property accessor creation for remoting serialization classes (e.g., `BatchAck.setTopic`).
**Verification:**
- Current `pom.xml` on `develop` branch sets `<fastjson2.version>2.0.63</fastjson2.version>` ✓
- Bazel BUILD files reference fastjson2 via `@maven//` — so the Maven version is the single source of truth ✓
- Upstream fix confirmed in fastjson2 2.0.64: [alibaba/fastjson2#7718](https://github.com/alibaba/fastjson2/pull/7718)
- Reproduction with `RemotingSerializableCompatTest` on JDK 8 is clear and deterministic ✓
**Impact:** Remoting serialization fails on JDK 8 cold start. Affects all JDK 8 deployments that hit the affected code path before fastjson2 internal caches are warmed.
**Severity:** Medium — JDK 8 is a supported runtime; the failure is order-dependent but reproducible in fresh JVMs.
**Proposed Fix:** Bump `fastjson2.version` from `2.0.63` → `2.0.64` in `pom.xml`. No code changes needed.
An automated fix PR can be generated. Reply `/approve` to proceed, or `/reject` to skip.
---
*Automated evaluation by github-manager*
--
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: commits-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Bug] fastjson2 2.0.63 fails on JDK 8 cold start with LambdaConversionException [rocketmq]
Posted by "lwclover (via GitHub)" <gi...@apache.org>.
lwclover closed issue #10927: [Bug] fastjson2 2.0.63 fails on JDK 8 cold start with LambdaConversionException
URL: https://github.com/apache/rocketmq/issues/10927
--
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: commits-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org