Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 11 additions & 10 deletions Common/Utils/src/FileFetcher.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,7 @@ bool FileFetcher::copyFile(size_t id)
bool aliencpMode = false;
std::string uuid{};
std::vector<std::string> logsToClean;
std::string dbgset{};
if (mCopyCmd.find("alien") != std::string::npos) {
if (!gGrid && !TGrid::Connect("alien://")) {
LOG(error) << "Copy command refers to alien but connection to Grid failed";
Expand All @@ -339,18 +340,18 @@ bool FileFetcher::copyFile(size_t id)
c = '_';
}
}
gSystem->Setenv("ALIENPY_DEBUG", "1");
logsToClean.push_back(fmt::format("log_alienpy_{}.txt", uuid));
gSystem->Setenv("ALIENPY_DEBUG_FILE", logsToClean.back().c_str());
gSystem->Setenv("XRD_LOGLEVEL", "Dump");
logsToClean.push_back(fmt::format("log_xrd_{}.txt", uuid));
gSystem->Setenv("XRD_LOGFILE", logsToClean.back().c_str());
LOGP(info, "debug log files for {}: ALIENPY_DEBUG_FILE={} XRD_LOGFILE={}", mInputFiles[id].getOrigName(),
getenv("ALIENPY_DEBUG_FILE") ? getenv("ALIENPY_DEBUG_FILE") : "",
getenv("XRD_LOGFILE") ? getenv("XRD_LOGFILE") : "");
if (!(getenv("ALIENPY_DEBUG") && std::stoi(getenv("ALIENPY_DEBUG")) == 1)) {
logsToClean.push_back(fmt::format("log_alienpy_{}.txt", uuid));
dbgset += fmt::format("ALIENPY_DEBUG=1 ALIENPY_DEBUG_FILE={} ", logsToClean.back());
}
if (!(getenv("XRD_LOGLEVEL") && strcmp(getenv("XRD_LOGLEVEL"), "Dump") == 0)) {
logsToClean.push_back(fmt::format("log_xrd_{}.txt", uuid));
dbgset += fmt::format("XRD_LOGLEVEL=Dump XRD_LOGFILE={} ", logsToClean.back());
}
LOGP(debug, "debug setting for for {}: {}", mInputFiles[id].getOrigName(), dbgset);
}
auto realCmd = std::regex_replace(std::regex_replace(mCopyCmd, std::regex(R"(\?src)"), mInputFiles[id].getOrigName()), std::regex(R"(\?dst)"), mInputFiles[id].getLocalName());
auto fullCmd = fmt::format(R"(sh -c "{}" >> {} 2>&1)", realCmd, mCopyCmdLogFile);
auto fullCmd = fmt::format(R"(sh -c "{}{}" >> {} 2>&1)", dbgset, realCmd, mCopyCmdLogFile);
LOG(info) << "Executing " << fullCmd;
const auto sysRet = gSystem->Exec(fullCmd.c_str());
if (sysRet != 0) {
Expand Down