Skip to content

[C++] Reset havePendingPingRequest flag for any data received from broker - #17658

Merged
codelipenghui merged 1 commit into
apache:masterfrom
merlimat:c++-update-pending-pong-response
Sep 15, 2022
Merged

[C++] Reset havePendingPingRequest flag for any data received from broker#17658
codelipenghui merged 1 commit into
apache:masterfrom
merlimat:c++-update-pending-pong-response

Conversation

@merlimat

@merlimat merlimat commented Sep 14, 2022

Copy link
Copy Markdown
Contributor

Motivation

The C++ client is waiting to receive a Pong response from broker and if it's not received within 30 seconds, it will forcefully close the connection, assuming the broker is unresponsive.

Java client was changed, a long time ago, to reset the havePendingPingRequest every time some data is read from the socket, instead of just when receiving the Ping response.

In C++, what can happen is that if there is a lot of messages being sent to the broker, and consequently lot of responses from the broker, and the application callbacks are taking long time (either blocking or just using a lot of CPU), then the Ping response might be sitting behind a lot of broker replies and it might take more than 30 seconds to actually process it.

During this time, we are still reading data from the socket and we shouldn't be considering the connection dead.

Modifications

In the C++ client, use the same logic used for Java client and treat any data read from the connection as a signal that the connection is healthy.

Documentation

  • doc-required
    (Your PR needs to update docs and you will update later)

  • doc-not-needed
    (Please explain why)

  • doc
    (Your PR contains doc changes)

  • doc-complete
    (Docs have been already added)

@merlimat merlimat added type/enhancement The enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messages release/2.9.4 release/2.8.5 release/2.11.1 release/2.10.3 labels Sep 14, 2022
@merlimat merlimat added this to the 2.11.0 milestone Sep 14, 2022
@merlimat merlimat self-assigned this Sep 14, 2022
@merlimat merlimat added doc-not-needed Your PR changes do not impact docs and removed doc-label-missing labels Sep 14, 2022
@apache apache deleted a comment from github-actions Bot Sep 14, 2022
@github-actions github-actions Bot added doc-label-missing and removed doc-not-needed Your PR changes do not impact docs labels Sep 14, 2022
@github-actions

Copy link
Copy Markdown

@merlimat Please provide a correct documentation label for your PR.
Instructions see Pulsar Documentation Label Guide.

@shibd shibd left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/LGTM

@merlimat merlimat added doc-not-needed Your PR changes do not impact docs and removed doc-label-missing labels Sep 15, 2022
@github-actions github-actions Bot added doc-label-missing and removed doc-not-needed Your PR changes do not impact docs labels Sep 15, 2022
@github-actions github-actions Bot added doc-not-needed Your PR changes do not impact docs and removed doc-label-missing labels Sep 15, 2022
@codelipenghui
codelipenghui merged commit c8b7962 into apache:master Sep 15, 2022
@merlimat
merlimat deleted the c++-update-pending-pong-response branch September 15, 2022 15:30
nicoloboschi pushed a commit to datastax/pulsar that referenced this pull request Sep 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cherry-picked/branch-2.8 Archived: 2.8 is end of life cherry-picked/branch-2.9 Archived: 2.9 is end of life cherry-picked/branch-2.10 cherry-picked/branch-2.11 doc-not-needed Your PR changes do not impact docs release/2.8.5 release/2.9.4 release/2.10.2 release/2.11.1 type/enhancement The enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants