CachedAssetRegistryDiscovery.bin rename failure when multiple volumes hit PlatformFileJournal wrap

I hit this during cook. When the Platform File Journal is invalidated/wrapped, FAssetDataDiscoveryCache::LoadAndUpdateCache() attempts to rename the discovery cache file `Intermediate/CachedAssetRegistryDiscovery.bin`. If the journal wraps on more than one volume, the first rename moves the file successfully, but the second rename (and further) fails with ERROR_FILE_NOT_FOUND because the source file has already been moved. This will produce an error and make cook fail.

The issue shows in the logs as:

  • multiple “LogAssetRegistry: Display: PlatformFileJournal journal has wrapped for volume ‘X:’.” (where X is each volume’s letter)
  • LogInit: Display: LogFileManager: Error: Error moving file ‘<project_path>/Intermediate/CachedAssetRegistryDiscovery.bin’ to ‘<project-path>/Intermediate/CachedAssetRegistryDiscovery-YYYY.MM.DD-HH.MM.SS.bin’.

It should be easy to prevent this by ensuring that the file is only renamed once.

[Attachment Removed]

Thanks, I will try to repro and apply your suggested fix later this week.

[Attachment Removed]

Fix submitted in CL 52149465, aka github commit 06b54058d72736e338844358d4b6f3b7c15c0d9a.

"AssetRegistry: DiscoveryCache: Fix spurious error when attempting to save old cache file for diagnostics. It would be triggered twice in one read attempt if the USN journal wrapped on two drives used by the project. and the second attempt would fail "

[Attachment Removed]