Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ack timeout cause reconnect #756

Merged

Conversation

wolfstudy
Copy link
Member

Signed-off-by: xiaolongran xiaolongran@tencent.com

Motivation

Most of this situation is caused by the timeout of sending the message. When the sending of the message times out, we will try to remove the object from the local pendingQueue, but after a period of time, the broker may push the message back, resulting in the connection reconnect occurs.

image

Follow Java SDK process logic:

            op = pendingMessages.peek();
            if (op == null) {
                if (log.isDebugEnabled()) {
                    log.debug("[{}] [{}] Got ack for timed out msg {} - {}", topic, producerName, sequenceId, highestSequenceId);
                }
                return;
            }

When a timeout occurs, we just need to drop the request instead of closing the connection.

Modifications

  • Remove reconnection timeout when sendReceipt timeout.

Signed-off-by: xiaolongran <xiaolongran@tencent.com>
@wolfstudy wolfstudy self-assigned this Apr 2, 2022
@wolfstudy wolfstudy added this to the v0.9.0 milestone Apr 2, 2022
Signed-off-by: xiaolongran <xiaolongran@tencent.com>
@wolfstudy wolfstudy merged commit 85d7661 into apache:master Apr 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants