Skip to content

Comments

Fixed some race condition issues in the C++ ContainerManager module.#2532

Open
linrunqi08 wants to merge 4 commits intomainfrom
feature/taiye/fix_cpp_container_race
Open

Fixed some race condition issues in the C++ ContainerManager module.#2532
linrunqi08 wants to merge 4 commits intomainfrom
feature/taiye/fix_cpp_container_race

Conversation

@linrunqi08
Copy link
Collaborator

No description provided.

@linrunqi08 linrunqi08 changed the title Xiūfù C++de ContainerManager mókuài zhōng yīxiē jìng tài tiáojiàn wèntí 33 Fixed some race condition issues in the C++ ContainerManager module. Fixed some race condition issues in the C++ ContainerManager module. Feb 11, 2026
@linrunqi08 linrunqi08 force-pushed the feature/taiye/fix_cpp_container_race branch from 0a5a314 to 23122d4 Compare February 11, 2026 08:57
}
}

void ContainerManager::updateContainerInfoPointersForContainers(const std::vector<std::string>& containerIDs) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

这个函数并没有用到,我理解是不是应该要放在incrementallyUpdateContainersSnapshot里面的

const auto& basePathInfos = options->GetBasePathInfos();
for (const auto& info : *containerInfos) {
// Protect access to mRawContainerInfo with lock
std::lock_guard<std::mutex> lock(mContainerMapMutex);
Copy link
Collaborator

Choose a reason for hiding this comment

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

这里锁的层次跟下面不太一样。下面for循环以外锁

std::unordered_map<std::string, std::shared_ptr<RawContainerInfo>> containerMapSnapshot;
{
std::lock_guard<std::mutex> lock(mContainerMapMutex);
containerMapSnapshot = mContainerMap;
Copy link
Collaborator

Choose a reason for hiding this comment

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

这里是深拷贝?

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