Skip to content

[ISSUE #511] Gson serialization failed, commitOffset can be negative.#510

Open
Kris20030907 wants to merge 1 commit intoapache:masterfrom
Kris20030907:fix-json
Open

[ISSUE #511] Gson serialization failed, commitOffset can be negative.#510
Kris20030907 wants to merge 1 commit intoapache:masterfrom
Kris20030907:fix-json

Conversation

@Kris20030907
Copy link
Copy Markdown

@Kris20030907 Kris20030907 commented Mar 31, 2026

What is the purpose of the change

commitOffset 有可能为 -1/-2, 此时由于 uint64, 赋值时会溢出,从而设置为一个非常大的数,当 RocketMQ 服务端请求 GetRunningInfo 接口时会出现 Gson 解析错误,原因是超过了 long 的最大值,导致该接口请求失败。最终影响订阅一致性的判断以及客户端运行中信息的获取。当使用新订阅组时一定会遇到该问题,且消费一段时间后重启,因为重试队列还没提交位点,因此该接口还是会报错。

The commitOffset could be -1 or -2. Since it's a uint64, this could overflow during assignment, resulting in a very large number. When the RocketMQ server requests the GetRunningInfo interface, a Gson parsing error will occur because the value exceeds the long threshold, causing the request to fail. Ultimately, this affects the consistency of the subscription.This issue will definitely occur when using a new subscription group.

Python SDK 底层会依赖 CPP, 因此 ERROR:
image

Brief changelog

update uint64 to int64

Verifying this change

@Kris20030907 Kris20030907 changed the title fix: json serialization failed, commitOffset can be negative. [ISSUE #511] Json serialization failed, commitOffset can be negative. Mar 31, 2026
@Kris20030907 Kris20030907 changed the title [ISSUE #511] Json serialization failed, commitOffset can be negative. [ISSUE #511] Gson serialization failed, commitOffset can be negative. Mar 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Cpp client serializes ConsumerRunningInfo.commitOffset with incompatible type for Java consumerRunningInfo decoding

1 participant