Skip to content

Commit c71caec

Browse files
committed
Fix use after free in rescheduleTasksFromReplica
1 parent 78304b3 commit c71caec

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/Storages/ObjectStorage/StorageObjectStorageStableTaskDistributor.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,8 +329,9 @@ void StorageObjectStorageStableTaskDistributor::rescheduleTasksFromReplica(size_
329329
"All replicas were marked as lost"
330330
);
331331

332+
auto files = std::move(processed_file_list_ptr->second);
332333
replica_to_files_to_be_processed.erase(number_of_current_replica);
333-
for (const auto & file : processed_file_list_ptr->second)
334+
for (const auto & file : files)
334335
{
335336
auto file_replica_idx = getReplicaForFile(file->getAbsolutePath().value_or(file->getPath()));
336337
unprocessed_files.emplace(file->getAbsolutePath().value_or(file->getPath()), std::make_pair(file, file_replica_idx));

tests/integration/test_s3_cluster/test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1195,7 +1195,7 @@ def test_joins(started_cluster):
11951195
assert len(res) == 25
11961196

11971197

1198-
def _test_graceful_shutdown(started_cluster):
1198+
def test_graceful_shutdown(started_cluster):
11991199
node = started_cluster.instances["s0_0_0"]
12001200
node_to_shutdown = started_cluster.instances["s0_1_0"]
12011201

0 commit comments

Comments
 (0)