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: flow heartbeat retry #5600

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/flow/src/heartbeat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,11 @@ impl HeartbeatTask {
warn!("Heartbeat task started multiple times");
return Ok(());
}

self.create_streams().await
}

pub async fn create_streams(&self) -> Result<(), Error> {
Copy link
Contributor

Choose a reason for hiding this comment

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

non-blocking: Does it need to be pub?

info!("Start to establish the heartbeat connection to metasrv.");
let (req_sender, resp_stream) = self
.meta_client
Expand Down Expand Up @@ -231,6 +236,8 @@ impl HeartbeatTask {
// set the timeout to half of the report interval so that it wouldn't delay heartbeat if something went horribly wrong
latest_report = query_flow_state(&query_stat_size, report_interval / 2).await;
}

info!("flownode heartbeat task stopped.");
});
}

Expand Down Expand Up @@ -274,7 +281,7 @@ impl HeartbeatTask {

info!("Try to re-establish the heartbeat connection to metasrv.");

if self.start().await.is_ok() {
if self.create_streams().await.is_ok() {
break;
}
}
Expand Down
Loading