Buildbot locks downloaded files
|Reported by:||parshin||Owned by:|
Description (last modified by sa2ajj)
OS: Windows XP SP2.
Steps to reproduce bug:
- Create two builds both with the following build steps:
- Download file from the master (FileDownload)
- Run shell command, which uses this file
- Run both builds simultaneously at the same slave.
In my case downloaded file was an executable, shell command was batch file which simply starts the executable.
With rather high probability (~50%) one of builds fails because of the executable was locked by another process.
Looks like the reason is the following. When files are downloaded at slave, slave process has two open handles. Next, if one build has finished download first, it starts separate process for shell command, which inherits all handles of the parent process (slave) including open handle for other downloading file (it is default behavior of Twisted spawnProcess() ). As a result, downloaded file is locked even after second build finishes download and close its handle.
I've tried to fix this problem by preventing handle inheritance by setting HANDLE_FLAG_INHERIT flag of handle to zero. Attached patch fixes that bug for me. Maybe, better solution is to download to temporary file and rename it after download.
Change History (15)
Changed 6 years ago by parshin
comment:13 Changed 2 years ago by sa2ajj
- Milestone changed from 0.9.+ to 0.8.x