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: fix PreservedDirDepth not working with polling and wildcard path #1866

Merged
merged 9 commits into from
Nov 25, 2024

Conversation

yyuuttaaoo
Copy link
Collaborator

No description provided.

@@ -157,11 +157,13 @@ void CreateHandler::Handle(const Event& event) {
if (!config.first)
return;
else if (event.IsDir())
ConfigManager::GetInstance()->RegisterHandlersRecursively(path, config, false);
ConfigManager::GetInstance()->RegisterHandlers(path, config);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

必须使用这个函数,因为要防止递归时注册超过PreservedDirDepth的过时的目录

}
return true;
}
if (preservedDirDepth < 0) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

=0和<0需要区分,=0时总是注册baseDir,<0时必须符合不超时的条件

// break;// fail early, do not try to register others
return false;
}
if (maxDepth == 0) {
return true;
}
bool result = true;

if (preservedDirDepth == 0) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

=0时就必须进入checkpoint恢复的注册方式,在此方式下保持PreservedDirDepth=0确保注册成功

@@ -149,15 +149,15 @@ void SLSClientManager::Stop() {
mIsUpdateRealIpThreadRunning = false;
}
mStopCV.notify_all();
if (mDataServerSwitchPolicy == EndpointSwitchPolicy::DESIGNATED_FIRST) {
if (mDataServerSwitchPolicy == EndpointSwitchPolicy::DESIGNATED_FIRST && mProbeNetworkThreadRes.valid()) {
Copy link
Collaborator

@messixukejia messixukejia Nov 17, 2024

Choose a reason for hiding this comment

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

这次pr valid补充了好几个地方,都比较散。很多都是Init函数创建的,是否有必要valid?

如果有必要,valid后续如何避免漏掉?

@yyuuttaaoo yyuuttaaoo merged commit 802d034 into alibaba:main Nov 25, 2024
15 checks passed
@yyuuttaaoo yyuuttaaoo deleted the fix/preserved_dir_depth_polling branch November 25, 2024 07:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants