Skip to content

Commit

Permalink
Added cancellation code and for queries, uberjobs, and czar restart.
Browse files Browse the repository at this point in the history
  • Loading branch information
jgates108 committed Sep 9, 2024
1 parent 660d6d5 commit be6ed7f
Show file tree
Hide file tree
Showing 46 changed files with 862 additions and 621 deletions.
10 changes: 4 additions & 6 deletions src/ccontrol/UserQuerySelect.cc
Original file line number Diff line number Diff line change
Expand Up @@ -364,8 +364,6 @@ void UserQuerySelect::buildAndSendUberJobs() {
// Make a map of all jobs in the executive.
// TODO:UJ Maybe a check should be made that all databases are in the same family?



// keep cycling through workers until no more chunks to place.
// - create a map of UberJobs key=<workerId>, val=<vector<uberjob::ptr>>
// - for chunkId in `unassignedChunksInQuery`
Expand Down Expand Up @@ -509,26 +507,26 @@ QueryState UserQuerySelect::join() {
if (finalRows < 0) finalRows = collectedRows;
// Notify workers on the query completion/cancellation to ensure
// resources are properly cleaned over there as well.
proto::QueryManagement::Operation operation = proto::QueryManagement::COMPLETE;
proto::QueryManagement::Operation operation = proto::QueryManagement::COMPLETE; //&&&QM
QueryState state = SUCCESS;
if (successful) {
_qMetaUpdateStatus(qmeta::QInfo::COMPLETED, collectedRows, collectedBytes, finalRows);
LOGS(_log, LOG_LVL_INFO, "Joined everything (success)");
} else if (_killed) {
// status is already set to ABORTED
LOGS(_log, LOG_LVL_ERROR, "Joined everything (killed)");
operation = proto::QueryManagement::CANCEL;
operation = proto::QueryManagement::CANCEL; //&&&QM
state = ERROR;
} else {
_qMetaUpdateStatus(qmeta::QInfo::FAILED, collectedRows, collectedBytes, finalRows);
LOGS(_log, LOG_LVL_ERROR, "Joined everything (failure!)");
operation = proto::QueryManagement::CANCEL;
operation = proto::QueryManagement::CANCEL; //&&&QM
state = ERROR;
}
auto const czarConfig = cconfig::CzarConfig::instance();
if (czarConfig->notifyWorkersOnQueryFinish()) {
try {
// &&& do this another way, also see executive::squash
// &&& do this another way, also see executive::squash &&&QM
xrdreq::QueryManagementAction::notifyAllWorkers(czarConfig->getXrootdFrontendUrl(), operation,
_qMetaCzarId, _qMetaQueryId);
} catch (std::exception const& ex) {
Expand Down
Loading

0 comments on commit be6ed7f

Please sign in to comment.