fix: Fix tasks will panic if one of them throw an exception. (#40760)

issue: #40690 
pr: https://github.com/milvus-io/milvus/pull/40691

Signed-off-by: sunby <sunbingyi1992@gmail.com>
This commit is contained in:
Bingyi Sun 2025-03-21 17:50:18 +08:00 committed by GitHub
parent 70ad96ffb3
commit d09483809c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -914,7 +914,7 @@ LoadFieldDatasFromRemote(const std::vector<std::string>& remote_files,
std::vector<std::future<FieldDataPtr>> futures;
futures.reserve(remote_files.size());
for (const auto& file : remote_files) {
auto future = pool.Submit([&]() {
auto future = pool.Submit([rcm, file]() {
auto fileSize = rcm->Size(file);
auto buf = std::shared_ptr<uint8_t[]>(new uint8_t[fileSize]);
rcm->Read(file, buf.get(), fileSize);