[ISSUE #511] Gson serialization failed, commitOffset can be negative.#510
Open
Kris20030907 wants to merge 1 commit intoapache:masterfrom
Open
[ISSUE #511] Gson serialization failed, commitOffset can be negative.#510Kris20030907 wants to merge 1 commit intoapache:masterfrom
Kris20030907 wants to merge 1 commit intoapache:masterfrom
Conversation
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.
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:

Brief changelog
update uint64 to int64
Verifying this change