Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SlaveDirectoryUploadCommand: Make more robust
On Windows, we've been repeatedly receiving exceptions from the slave-side, because the buildslave process wasn't able to remove the temporary file after the upload has finished. This buildslave is running three builds in parallel at a time. We don't see this issues when running just one build at a time, surprisingly. This patch reduces the number of file objects created for an OS-level handle and seems to fully fix the issue. Multiple reports about this issue: - https://lists.buildbot.net/pipermail/devel/2009-December/005513.html - http://trac.buildbot.net/ticket/3052 Fixes http://trac.buildbot.net/ticket/3052 Exception captured on the build slave on a Windows 10 machine: ``` <buildslave.commands.transfer.SlaveDirectoryUploadCommand instance at 0x0000000003947248> 2017-03-23 05:22:44-0700 [Broker,client] Unhandled Error Traceback (most recent call last): File "c:\Python27\lib\site-packages\twisted\spread\pb.py", line 565, in expressionReceived method(*sexp[1:]) File "c:\Python27\lib\site-packages\twisted\spread\pb.py", line 935, in proto_answer d.callback(self.unserialize(netResult)) File "c:\Python27\lib\site-packages\twisted\internet\defer.py", line 383, in callback self._startRunCallbacks(result) File "c:\Python27\lib\site-packages\twisted\internet\defer.py", line 491, in _startRunCallbacks self._runCallbacks() --- <exception caught here> --- File "c:\Python27\lib\site-packages\twisted\internet\defer.py", line 578, in _runCallbacks current.result = callback(current.result, *args, **kw) File "c:\Python27\lib\site-packages\buildslave\commands\transfer.py", line 248, in finished os.remove(self.tarname) exceptions.WindowsError: [Error 32] The process cannot access the file because it is being used by another process: 'c:\\users\\foo\\appdata\\local\\temp\\tmp4altyc' ```
- Loading branch information