Skip to content
This repository was archived by the owner on Jan 13, 2025. It is now read-only.

Conversation

@jpobst
Copy link
Contributor

@jpobst jpobst commented Oct 13, 2022

Occasionally on CI we see messages like this:

/Users/runner/.nuget/packages/xamarin.build.download/0.11.3/buildTransitive/Xamarin.Build.Download.targets(52,3): 
The file '/Users/runner/Library/Caches/XamarinBuildDownload/playservicesbasement-18.1.0/playservicesbasement-18.1.0.aar'
already exists. [/Users/runner/work/1/s/generated/com.google.assistant.appactions.widgets/com.google.assistant.appactions.widgets.csproj]

In the log we can see that we tried to use XDB to download this file twice at the same time:

// com.google.assistant.appactions.suggestions.csproj
Start: 2022-10-12 16:00:34.7892260
End: 2022-10-12 16:00:35.4315150
Downloading https://dl.google.com/dl/android/maven2/com/google/android/gms/play-services-basement/18.1.0/play-services-basement-18.1.0.aar to /Users/runner/Library/Caches/XamarinBuildDownload/playservicesbasement-18.1.0.aar
// com.google.assistant.appactions.widgets.csproj
Start: 2022-10-12 16:00:35.1521780
End: 2022-10-12 16:00:35.7901080
Downloading https://dl.google.com/dl/android/maven2/com/google/android/gms/play-services-basement/18.1.0/play-services-basement-18.1.0.aar to /Users/runner/Library/Caches/XamarinBuildDownload/playservicesbasement-18.1.0.aar

The first one succeeds but the second one fails with the "file already exists" errors.

Attempt to guard against this by checking for the "already downloaded" flag a second time once we acquire the directory lock. This way we should bail if another process completed the download while we were waiting for them to release the lock.

@jpobst jpobst marked this pull request as ready for review October 13, 2022 14:41
@jpobst jpobst requested a review from moljac October 13, 2022 14:42
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants