18842: Added tests for specific disk cache behavior
[arvados.git] / sdk / python / arvados / diskcache.py
index 9734d93a7742d6bf395b4fe2dbed2e907ab50a4d..939ca3bb3c543191e3c24c39f353fb23a37ec2ba 100644 (file)
@@ -9,6 +9,7 @@ import traceback
 import stat
 import tempfile
 import fcntl
+import time
 import errno
 import logging
 
@@ -143,7 +144,7 @@ class DiskCacheSlot(object):
                     # The locking strategy ensures that cache blocks
                     # in use remain visible.
                     #
-                    fcntl.flock(filehandle, fcntl.LOCK_EX | fcntl.LOCK_NB)
+                    fcntl.flock(f, fcntl.LOCK_EX | fcntl.LOCK_NB)
 
                     os.remove(final)
                     return True