DIRACGrid/DIRAC — pull request #357 by KrzysztofCiba (2011-12-05 09:17:54+00:00)
Title: FIX KeyError in TransferDB.getObservedChannelThroughput 

Hi,

A new source of KeyError has been spotted today when running ReplicationScheduler by Federico. The TransferDB.getObservedChannelThrougput was blindly using channelTimeDict to compute bandwidths w/o checking if channelD is indeed defined as a key over there. Now fixed.

Here is the traceback:

runit/DataManagement/ReplicationScheduler/log/current:2011-12-05 08:42:24 UTC DataManagement/ReplicationScheduler EXCEPT: Exception while calling > method
runit/DataManagement/ReplicationScheduler/log/current:2011-12-05 08:42:24 UTC DataManagement/ReplicationScheduler EXCEPT: == EXCEPTION ==
runit/DataManagement/ReplicationScheduler/log/current:2011-12-05 08:42:24 UTC DataManagement/ReplicationScheduler EXCEPT: :27L
runit/DataManagement/ReplicationScheduler/log/current:2011-12-05 08:42:24 UTC DataManagement/ReplicationScheduler EXCEPT: File "/opt/dirac/pro/DIRAC/Core/Base/AgentModule.py", line 307, in am_secureCall
runit/DataManagement/ReplicationScheduler/log/current:2011-12-05 08:42:24 UTC DataManagement/ReplicationScheduler EXCEPT: result = functor( *args )
runit/DataManagement/ReplicationScheduler/log/current:2011-12-05 08:42:24 UTC DataManagement/ReplicationScheduler EXCEPT:
runit/DataManagement/ReplicationScheduler/log/current:2011-12-05 08:42:24 UTC DataManagement/ReplicationScheduler EXCEPT: File "/opt/dirac/pro/DIRAC/DataManagementSystem/Agent/ReplicationScheduler.py", line 67, in execute
runit/DataManagement/ReplicationScheduler/log/current:2011-12-05 08:42:24 UTC DataManagement/ReplicationScheduler EXCEPT: res = self.TransferDB.getChannelObservedThroughput( self.throughputTimescale )
runit/DataManagement/ReplicationScheduler/log/current:2011-12-05 08:42:24 UTC DataManagement/ReplicationScheduler EXCEPT:
runit/DataManagement/ReplicationScheduler/log/current:2011-12-05 08:42:24 UTC DataManagement/ReplicationScheduler EXCEPT: File "/opt/dirac/pro/DIRAC/DataManagementSystem/DB/TransferDB.py", line 633, in getChannelObservedThroughput
runit/DataManagement/ReplicationScheduler/log/current:2011-12-05 08:42:24 UTC DataManagement/ReplicationScheduler EXCEPT: throughPut = float(data)/channelTimeDict[channelID]
runit/DataManagement/ReplicationScheduler/log/current:2011-12-05 08:42:24 UTC DataManagement/ReplicationScheduler EXCEPT: ===============