utils
deepdrivewe.utils ¶
Workflow utils.
wait_for_file
async
¶
Wait for a file to appear on a shared filesystem.
Forces NFS attribute cache invalidation by listing the parent directory, then retries with a delay. Needed on HPC clusters where Parsl workers run on different nodes and NFS caches may be stale.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
Path
|
The file path to wait for. |
required |
logger
|
Logger
|
Logger for reporting retry attempts. |
required |
retries
|
int
|
Maximum number of retries before raising. |
8
|
delay
|
float
|
Initial delay in seconds (doubles each retry). |
1.0
|
Raises:
| Type | Description |
|---|---|
FileNotFoundError
|
If the file is not found after all retries. |
Source code in deepdrivewe/utils.py
retry_on_exception ¶
Retry a function if an exception is raised.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
wait_time
|
int
|
Time to wait before retrying the function. |
required |