Skip to content

[Enhancement] The client reports heartbeats to the broker using an asynchronous method. #9368

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

Open
1 task done
chenyi19851209 opened this issue Apr 27, 2025 · 3 comments
Open
1 task done

Comments

@chenyi19851209
Copy link

Before Creating the Enhancement Request

  • I have confirmed that this should be classified as an enhancement rather than a bug/feature.

Summary

I hope to change the way the client reports heartbeats to the broker to an asynchronous method. The scenarios I am considering are as follows: During batch publishing for the broker or IDC (Internet Data Center) network disconnection drills, the client synchronously reports heartbeats to the broker that has abnormally disconnected. This causes continuous blocking and waiting timeouts in heartbeat reporting, which in turn leads to significant delays in the client's heartbeat reporting to the normally connected brokers. Changing to asynchronous heartbeat reporting can prevent the abnormal broker from blocking the heartbeat reporting to the normal brokers.

Motivation

Avoid heartbeat blocking in scenarios such as batch publish and restarts of the broker, as well as IDC (Internet Data Center) anomaly drills.

Describe the Solution You'd Like

The method of the client sending heartbeats to a single broker is changed to an asynchronous sending method(InvokeAsync)

Describe Alternatives You've Considered

none

Additional Context

No response

@chenyi19851209
Copy link
Author

chenyi19851209 commented Apr 27, 2025

Specific code location

Image

Image

@yx9o
Copy link
Contributor

yx9o commented Apr 28, 2025

The broker will map some data when processing the heartbeat. Will this cause the data obtained by other interfaces to have time differences or be incorrect?

@chenyi19851209
Copy link
Author

Currently, I see that there are three locations on the broker server where a map is maintained to process heartbeat data. They are all concurrent maps, and not require the order of processing. The expected asynchronous reporting of heartbeats can accelerate the acquisition of correct data and will not lead to worse results

Image

Image

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants