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

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

Merged

Conversation

merlimat
Copy link
Contributor

@merlimat merlimat commented Sep 14, 2022

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

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

Copy link
Member

@shibd shibd left a comment

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