Skip to content

Commit 59da55d

Browse files
authored
Fix race condition for writing local cache state (#113)
1 parent 4c1d795 commit 59da55d

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/Common/Caching/CacheClient.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -490,13 +490,12 @@ async Task PlaceFilesAsync(CancellationToken ct)
490490

491491
Task placeFilesTask = cacheEntry.PlaceFilesAsync(context, outputsToPlace, ct);
492492
tasks.Add(placeFilesTask);
493+
await Task.WhenAll(tasks);
493494

494495
if (_localCacheStateManager is not null)
495496
{
496497
await _localCacheStateManager.WriteStateFileAsync(nodeContext, nodeBuildResult);
497498
}
498-
499-
await Task.WhenAll(tasks);
500499
}
501500

502501
if (_enableAsyncMaterialization)

0 commit comments

Comments
 (0)