-
Notifications
You must be signed in to change notification settings - Fork 391
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
fix: fix PreservedDirDepth not working with polling and wildcard path #1866
Conversation
@@ -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); |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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()) { |
There was a problem hiding this comment.
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后续如何避免漏掉?
No description provided.