-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle filesystem latency when creating
RUN_COMPLETE
file (#803)
* Catch unhandled TimeoutError and log status * Increase RUN_COMPLETE timeout to 30 seconds File system quirks mean that the RUN_COMPLETE file may not yet exist on the file system after it is created. Since the file is used by the same process relatively soon after creation, this can occassionally cause a FileNotFoundError. It was therefore necessary to wait for the file to be synced to the file system, and to impose a timeout. The previous timeout value was too short and resulted in TimeoutErrors relatively frequently. This commit increases the timeout value from 2 seconds to 30 seconds, per the suggestion of Paul Ferrell. * Add fallback if RUN_COMPLETE is not present The idiosyncrocies of NFS means that when the RUN_COMPLETE file is written, it may not appear on the local file system, which results in a FileNotFoundError when that file is accessed. This commit adds a fallback when the file does not exist on the local file system, in the process reverting the previous solution which involved waiting and eventually raising a timeout. The fallback consists of the following steps: 1. Create the file as normal, and check whether it exists. 2. If it does not exist, attempt to force an NFS cache reset by listing the contents of the parent directory. 3. If the file still does not exist, create a symlink to the location where the file is expected eventually to be. * Add unit test for missing RUN_COMPLETE file fallback * Fix failing style tests * Fix error
- Loading branch information
1 parent
8dad702
commit 00aae1a
Showing
2 changed files
with
72 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters