From bc8dd4c0613749ad495aee372a3b76d073ad0c23 Mon Sep 17 00:00:00 2001
From: Fabrice Le Goff <fabrice.le.goff@cern.ch>
Date: Mon, 8 Oct 2018 14:11:07 +0200
Subject: [PATCH] add filesize and copy timeout info in the problematic file
 log message

---
 Script/ManagerThread.py | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/Script/ManagerThread.py b/Script/ManagerThread.py
index 5ec1eda..a405ef2 100644
--- a/Script/ManagerThread.py
+++ b/Script/ManagerThread.py
@@ -6,7 +6,6 @@ It is in charge of ls on SFO disk.
 """
 
 import threading, os, glob
-import os.path
 from time import time
 import logging
 import datetime
@@ -281,18 +280,18 @@ class ManagerThread(threading.Thread):
         #print len(self.ProblDict)
 
         # Try to copy the file again only if the timeout is expired
-        if (time()-timestamp) > \
-        self.ProblDelay*math.exp(self.ProblScalingFactor*nretry) :
+        if (time()-timestamp) > (self.ProblDelay * math.exp(self.ProblScalingFactor*nretry)):
             nretry += 1
             self.ProblDict[ProblFile] = [time(), nretry]
             self.logger.debug('Time to retry (%d times up to now)', nretry)
 
             # Inform the user if we cannot copy the file and the retry time
             # limit has been reached
-            if self.ProblDelay*math.exp(self.ProblScalingFactor*nretry) > \
-                   self.ProblDelayLimit:
+            if self.ProblDelay*math.exp(self.ProblScalingFactor*nretry) > self.ProblDelayLimit:
+                filesize = os.path.getsize(ProblFile)
                 self.logger.critical('Problematic file %s reached the delay retry limit of %d seconds. '
-                        'Please have a look!', ProblFile, self.ProblDelayLimit)
+                        'Please have a look! (filesize= %d, copy_timeout= %d)',
+                        ProblFile, self.ProblDelayLimit, filesize, self.conf.NoneTimeout)
             return True
         else:
             self.logger.debug('Last retry was too recent: retry later')
-- 
GitLab