MCPcopy Create free account
hub / github.com/ClickHouse/ClickHouse / cancelAll

Method cancelAll

src/Backups/BackupsWorker.cpp:1427–1450  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1425
1426
1427void BackupsWorker::cancelAll(bool wait_)
1428{
1429 std::vector<OperationID> current_operations;
1430 {
1431 std::lock_guard lock{infos_mutex};
1432 for (const auto & [id, extended_info] : infos)
1433 if (!isFinalStatus(extended_info.info.status))
1434 current_operations.push_back(id);
1435 }
1436
1437 if (current_operations.empty())
1438 return;
1439
1440 LOG_INFO(log, "Cancelling running backups and restores");
1441
1442 for (const auto & id : current_operations)
1443 cancel(id, /* wait= */ false);
1444
1445 if (wait_)
1446 for (const auto & id : current_operations)
1447 wait(id, /* rethrow_exception= */ false);
1448
1449 LOG_INFO(log, "Backups and restores finished or stopped");
1450}
1451
1452
1453BackupOperationInfo BackupsWorker::getInfo(const OperationID & id) const

Callers 2

onCanaryOOMMethod · 0.45

Calls 4

isFinalStatusFunction · 0.85
waitFunction · 0.50
push_backMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected