Commit b9128ea1 authored by Maiken's avatar Maiken

Merge branch 'bugs-3855-3' into 'master'

fix bugs in MR 826, blocking EMI-ES submission

See merge request nordugrid/arc!837
parents ab87fb3d 13880411
...@@ -472,7 +472,7 @@ bool DirDeleteExcl(const std::string& path, const std::list<std::string>& files, ...@@ -472,7 +472,7 @@ bool DirDeleteExcl(const std::string& path, const std::list<std::string>& files,
// Check for file or dir // Check for file or dir
struct stat st; struct stat st;
if (!FileStat(*d, &st, uid, gid, false)) return false; if (!FileStat(*d, &st, uid, gid, false)) return false;
if (S_ISDIR(st.st_mode)) { if (S_ISDIR(st.st_mode)) {
// Check for any files in this dir // Check for any files in this dir
std::list<std::string> newfiles; std::list<std::string> newfiles;
for (std::list<std::string>::const_iterator f = files.begin(); f != files.end(); ++f) { for (std::list<std::string>::const_iterator f = files.begin(); f != files.end(); ++f) {
......
...@@ -604,7 +604,11 @@ bool DTRGenerator::processReceivedDTR(DataStaging::DTR_ptr dtr) { ...@@ -604,7 +604,11 @@ bool DTRGenerator::processReceivedDTR(DataStaging::DTR_ptr dtr) {
logger.msg(Arc::WARNING, "%s: Failed to read list of input files, can't clean up session dir", jobid); logger.msg(Arc::WARNING, "%s: Failed to read list of input files, can't clean up session dir", jobid);
else { else {
std::list<std::string> todelete(files.size()); std::list<std::string> todelete(files.size());
std::transform(files.begin(), files.end(), todelete.begin(), filedata_pfn); for (std::list<FileData>::const_iterator f = files.begin(); f != files.end(); ++f) {
if (f->lfn.find(':') != std::string::npos) {
todelete.push_back(f->pfn);
}
}
if (!Arc::DirDeleteExcl(job->SessionDir(), todelete, false, job_uid, job_gid)) { if (!Arc::DirDeleteExcl(job->SessionDir(), todelete, false, job_uid, job_gid)) {
logger.msg(Arc::WARNING, "%s: Failed to clean up session dir", jobid); logger.msg(Arc::WARNING, "%s: Failed to clean up session dir", jobid);
} }
...@@ -721,7 +725,11 @@ bool DTRGenerator::processReceivedJob(GMJobRef& job) { ...@@ -721,7 +725,11 @@ bool DTRGenerator::processReceivedJob(GMJobRef& job) {
} }
// pre-clean session dir before downloading // pre-clean session dir before downloading
std::list<std::string> todelete(files.size()); std::list<std::string> todelete(files.size());
std::transform(files.begin(), files.end(), todelete.begin(), filedata_pfn); for (std::list<FileData>::const_iterator f = files.begin(); f != files.end(); ++f) {
if (f->lfn.find(':') != std::string::npos) {
todelete.push_back(f->pfn);
}
}
if (!Arc::DirDeleteExcl(job->SessionDir(), todelete, false, job_uid, job_gid)) { if (!Arc::DirDeleteExcl(job->SessionDir(), todelete, false, job_uid, job_gid)) {
logger.msg(Arc::ERROR, "%s: Failed to clean up session dir", jobid); logger.msg(Arc::ERROR, "%s: Failed to clean up session dir", jobid);
dtrs_lock.lock(); dtrs_lock.lock();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment