Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add retry handling for rmRF invocation in dependency-check-build-task.ts #138

Open
hlovdal opened this issue Nov 16, 2023 · 0 comments
Open

Comments

@hlovdal
Copy link

hlovdal commented Nov 16, 2023

azuredevops/src/Tasks/dependency-check-build-task/dependency-check-build-task.ts contains

    await console.log('Downloading ZIP from "' + zipUrl + '"...');
    ...
    tl.rmRF(zipLocation);

however this file removal is not unlikely to fail if an anti-virus program is currently scanning the file or some other file monitoring program holds the file open. Such failures breaks the build:

Downloading ZIP from "https://github.com/jeremylong/DependencyCheck/releases/download/v8.4.3/dependency-check-8.4.3-release.zip"...
Failed rmRF: EPERM: operation not permitted, unlink 'C:\Agent\_work\_tasks\dependency-check-build-task_47ea1f4a-57ba-414a-b12e-c44f42765e72\6.1.1\dependency-check-8.4.3-release.zip'
##[error]Failed rmRF: EPERM: operation not permitted, unlink 'C:\Agent\_work\_tasks\dependency-check-build-task_47ea1f4a-57ba-414a-b12e-c44f42765e72\6.1.1\dependency-check-8.4.3-release.zip'
##[error]Unhandled error condition detected.
Ending Dependency Check...

It would be nice if the file remove operation was wrapped with retry policy handling similar to the what is used for downloading, with an additional time delay between attempts (say exponential back-off up till 2-5 minutes), so that there is a chance of recovery from such removal failures.

@hlovdal hlovdal changed the title Add retry handling for rmRF invokation in dependency-check-build-task.ts Add retry handling for rmRF invocation in dependency-check-build-task.ts Dec 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant