Teradata / PyTd

A Python Module to make it easy to script powerful interactions with Teradata Database in a DevOps friendly way.
MIT License
108 stars 43 forks source link

_Cleanup Logs failing because of race condition on deleting logs #79

Open clydewatts opened 6 years ago

clydewatts commented 6 years ago

Hi ,

I am running multiple instances of the a python script simultaneously , and got a race condition on the deleting of old logs. (def _cleanupLogs). This is the first time i have seen this occurrence.

Traceback (most recent call last): File "/home/prod/bin/ftp_downloader.py", line 1044, in sys.exit(run_as_script()) File "/home/prod/bin/ftp_downloader.py", line 1012, in run_as_script options.job_id File "/home/prod/bin/ftp_downloader.py", line 80, in init self.udaExec = teradata.UdaExec(appName='ftp_downloader', version=1) File "build/bdist.linux-x86_64/egg/teradata/udaexec.py", line 123, in init File "build/bdist.linux-x86_64/egg/teradata/udaexec.py", line 250, in _initLogging File "build/bdist.linux-x86_64/egg/teradata/udaexec.py", line 276, in _cleanupLogs OSError: [Errno 2] No such file or directory: 'logs/ftp_downloader.20170706021004-2480.log'