Skip to content

Commit

Permalink
Fixes several formatting of node names in logs (#443)
Browse files Browse the repository at this point in the history
  • Loading branch information
luc-guyot-infomaniak authored Dec 19, 2024
1 parent 6ec3a1e commit 64fe145
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions src/libsyncengine/propagation/executor/executorworker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1000,7 +1000,7 @@ ExitInfo ExecutorWorker::generateEditJob(SyncOpPtr syncOp, std::shared_ptr<Abstr
LOGW_SYNCPAL_WARN(_logger, L"Edit operation with empty corresponding node id for "
<< Utility::formatSyncPath(absoluteLocalFilePath));
sentry::Handler::captureMessage(sentry::Level::Warning, "ExecutorWorker::generateEditJob",
"Edit operation with empty corresponding node id");
"Edit operation with empty corresponding node id");
return ExitCode::DataError;
}

Expand Down Expand Up @@ -1606,14 +1606,14 @@ ExitInfo ExecutorWorker::handleManagedBackError(ExitCause jobExitCause, SyncOpPt
}

if (!affectedUpdateTree(syncOp)->deleteNode(syncOp->affectedNode())) {
LOGW_SYNCPAL_WARN(_logger, L"Error in UpdateTree::deleteNode: node name="
<< Utility::formatSyncName(syncOp->affectedNode()->name()));
LOGW_SYNCPAL_WARN(_logger,
L"Error in UpdateTree::deleteNode: node " << Utility::formatSyncName(syncOp->affectedNode()->name()));
return ExitCode::DataError;
}

if (syncOp->correspondingNode()) {
if (!targetUpdateTree(syncOp)->deleteNode(syncOp->correspondingNode())) {
LOGW_SYNCPAL_WARN(_logger, L"Error in UpdateTree::deleteNode: node name="
LOGW_SYNCPAL_WARN(_logger, L"Error in UpdateTree::deleteNode: node "
<< Utility::formatSyncName(syncOp->correspondingNode()->name()));
return ExitCode::DataError;
}
Expand Down Expand Up @@ -2476,13 +2476,13 @@ void ExecutorWorker::increaseErrorCount(SyncOpPtr syncOp) {
syncOp->affectedNode()->getPath(), otherSide(syncOp->targetSide()));

if (!affectedUpdateTree(syncOp)->deleteNode(syncOp->affectedNode())) {
LOGW_SYNCPAL_WARN(_logger, L"Error in UpdateTree::deleteNode: node name="
LOGW_SYNCPAL_WARN(_logger, L"Error in UpdateTree::deleteNode: node "
<< Utility::formatSyncName(syncOp->affectedNode()->name()));
}

if (syncOp->correspondingNode() && syncOp->correspondingNode()->id().has_value()) {
if (!targetUpdateTree(syncOp)->deleteNode(syncOp->correspondingNode())) {
LOGW_SYNCPAL_WARN(_logger, L"Error in UpdateTree::deleteNode: node name="
LOGW_SYNCPAL_WARN(_logger, L"Error in UpdateTree::deleteNode: node "
<< Utility::formatSyncName(syncOp->correspondingNode()->name()));
}
}
Expand Down Expand Up @@ -2554,14 +2554,15 @@ ExitInfo ExecutorWorker::handleOpsFileAccessError(SyncOpPtr syncOp, ExitInfo ops
if (syncOp->targetSide() == ReplicaSide::Local && syncOp->type() == OperationType::Create) {
// The item does not exist yet locally, we will only tmpBlacklist the remote item
if (ExitInfo exitInfo = _syncPal->handleAccessDeniedItem(syncOp->localCreationTargetPath(), localBlacklistedNode,
remoteBlacklistedNode, opsExitInfo.cause()); !exitInfo) {
remoteBlacklistedNode, opsExitInfo.cause());
!exitInfo) {
return exitInfo;
}
} else {
// Both local and remote item will be temporarily blacklisted
auto localNode = syncOp->targetSide() == ReplicaSide::Remote ? syncOp->affectedNode() : syncOp->correspondingNode();
if (!localNode) return ExitCode::LogicError;

const SyncPath relativeLocalFilePath = localNode->getPath();
if (ExitInfo exitInfo = _syncPal->handleAccessDeniedItem(relativeLocalFilePath, localBlacklistedNode,
remoteBlacklistedNode, opsExitInfo.cause());
Expand Down Expand Up @@ -2613,13 +2614,13 @@ ExitInfo ExecutorWorker::handleOpsAlreadyExistError(SyncOpPtr syncOp, ExitInfo o
syncOp->affectedNode()->id().has_value() ? *syncOp->affectedNode()->id() : std::string(), relativeLocalPath,
ReplicaSide::Remote);
if (!affectedUpdateTree(syncOp)->deleteNode(syncOp->affectedNode())) {
LOGW_SYNCPAL_WARN(_logger, L"Error in UpdateTree::deleteNode: node name="
LOGW_SYNCPAL_WARN(_logger, L"Error in UpdateTree::deleteNode: node "
<< Utility::formatSyncName(syncOp->affectedNode()->name()));
return ExitCode::DataError;
}

if (syncOp->correspondingNode() && !targetUpdateTree(syncOp)->deleteNode(syncOp->correspondingNode())) {
LOGW_SYNCPAL_WARN(_logger, L"Error in UpdateTree::deleteNode: node name="
LOGW_SYNCPAL_WARN(_logger, L"Error in UpdateTree::deleteNode: node "
<< Utility::formatSyncName(syncOp->correspondingNode()->name()));
return ExitCode::DataError;
}
Expand Down Expand Up @@ -2705,7 +2706,7 @@ ExitInfo ExecutorWorker::removeDependentOps(std::shared_ptr<Node> localNode, std
if (remoteNode && remoteNode2 && (remoteNode->isParentOf(remoteNode2))) {
LOGW_SYNCPAL_DEBUG(_logger, L"Removing " << syncOp2->type() << L" operation on " << Utility::formatSyncName(nodeName)
<< L" because it depends on " << opType << L" operation on "
<< Utility::formatSyncName(remoteNode->name()) << L"wich failed.");
<< Utility::formatSyncName(remoteNode->name()) << L" which failed.");

dependentOps.push_back(opId);
}
Expand Down

0 comments on commit 64fe145

Please sign in to comment.