While working on #58, I noticed quite frequently the following exception:
Exception ignored in: <bound method FTPConnector.__del__ of <datamover.connectors.FTPConnector object at 0x7ff706714320>>
Traceback (most recent call last):
File "/home/ubuntu/data-repository/file_transfer/datamover/connectors.py", line 281, in __del__
self._ftp.quit()
File "/home/ubuntu/miniconda2/envs/enramtransfer/lib/python3.5/ftplib.py", line 664, in quit
resp = self.voidcmd('QUIT')
File "/home/ubuntu/miniconda2/envs/enramtransfer/lib/python3.5/ftplib.py", line 277, in voidcmd
return self.voidresp()
File "/home/ubuntu/miniconda2/envs/enramtransfer/lib/python3.5/ftplib.py", line 250, in voidresp
resp = self.getresp()
File "/home/ubuntu/miniconda2/envs/enramtransfer/lib/python3.5/ftplib.py", line 243, in getresp
raise error_temp(resp)
ftplib.error_temp: 421 Timeout.
This always seems to happen during FTPConnector.__del__: does that mean the transfer itself is successful and just the disconnect fails? In that case, can we safely ignore this error?
Update: the FTP disconnect shouldn't probably happen in __del__ since there's no guarantee when/if this method will be called. So:
We can safely ignore this exception now (but it would be cleaner to catch it) and properly log the event instead of letting this stack trace pollute the log file.
We should probably refactor to ensure the connection is closed when it's not needed anymore (with keyword?)
While working on #58, I noticed quite frequently the following exception:
This always seems to happen during
FTPConnector.__del__
: does that mean the transfer itself is successful and just the disconnect fails? In that case, can we safely ignore this error?