Skip to content

[Bug] Missing of valueOfCurrentMinusBorn equals checkImmunityTime #9486

Open
@WJ66880

Description

@WJ66880

Before Creating the Bug Report

  • I found a bug, not just asking a question, which should be created in GitHub Discussions.

  • I have searched the GitHub Issues and GitHub Discussions of this repository and believe that this is not a duplicate.

  • I have confirmed that this bug belongs to the current repository, not other repositories of RocketMQ.

Runtime platform environment

It has nothing to do with the OS.

RocketMQ version

Using version: 432, bug the latest version has the same bug.

JDK Version

It has nothing to do with the JDK.

Describe the Bug

In transaction message check task, when valueOfCurrentMinusBorn == checkImmunityTime, the current half offset will drive the while(true) loop for dozens of times.
See the debug picture below:

Image

logs in transaction.log picture:

Image

Steps to Reproduce

Send tx message withe a hign throughput, and return commit or rollback in executeLocalTranstion method use condition
if (counter.getAndIncrement() % 100 == 0) { return LocalTransactionState.COMMIT_MESSAGE; } return LocalTransactionState.UNKNOW;

What Did You Expect to See?

When valueOfCurrentMinusBorn == checkImmunityTime happened by chance, break the loop or trigger the check back, either is ok. I prefer to choose break.

What Did You See Instead?

When valueOfCurrentMinusBorn == checkImmunityTime happened by chance, the while(true) loop didn't break.

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions