https://bugs.winehq.org/show_bug.cgi?id=40239
Bug ID: 40239 Summary: Submitting more than one job for a given file fails Product: Wine-Testbot Version: unspecified Hardware: x86 OS: Linux Status: NEW Severity: normal Priority: P2 Component: unknown Assignee: wine-bugs@winehq.org Reporter: fgouget@codeweavers.com Distribution: ---
Steps to reproduce: * Open the 'Submit job' page in two windows. * In both select the same file, for instance a patch.diff file or mytest.exe one. * Fill the Remarks field and click on the next button in both windows. * Continue the submission process on both sides. * At the end one job will work and the other will have 'unknown' written in the 'File name' column and fail with a TestBot error.
During the submission process the server faces the following conditions: * The server needs the uploaded file early in the submission process so it can analyze it and adjust the questions it asks later (e.g. prefill the command line for patches, only present 64 bit VMs for 64 bit executables, etc.). * There is no job yet to store the user-provided file. So it is stored in a temporary 'staging' area and then moved into place when the job is created. * The user can abandon the submission process at any time which causes the temporary files he uploaded to be orphaned. To deal with this issue the server has a garbage collecting mechanism. * To avoid interference between users if they upload files that have the same name the temporary filename is prefixed with a per-user string. * However nothing prevents a collision in the staging area starts two job submissions at the same time for the same file. This is what happens in the steps above.
That last point is somewhat intentional as it limits the accumulation of orphaned files if a user abandons a submission only to pick it up a bit later. But getting a broken job is wrong in any case.