* Fix race condition where asset would finish loading and another request would start before the streamer request could be cleared
Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com>
* Re-enable disabled test which was failing for the same reason.
Fix test timeout which was way too long.
Reduce test iterations to keep test time safely under 5 seconds.
Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com>
* Instead of using a mutex, re-order the statements to remove the streamer request first
Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com>
(cherry picked from commit 0cea59d669)
Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com>
This commit is contained in:
@@ -1677,9 +1677,13 @@ namespace AZ
|
||||
// they will trigger a ReleaseAsset call sometime after the AssetManager has begun to shut down, which can lead to
|
||||
// race conditions.
|
||||
|
||||
// Make sure the streamer request is removed first before the asset is released
|
||||
// If the asset is released first it could lead to a race condition where another thread starts loading the asset
|
||||
// again and attempts to add a new streamer request with the same ID before the old one has been removed, causing
|
||||
// that load request to fail
|
||||
RemoveActiveStreamerRequest(assetId);
|
||||
weakAsset = {};
|
||||
loadingAsset.Reset();
|
||||
RemoveActiveStreamerRequest(assetId);
|
||||
};
|
||||
|
||||
auto&& [deadline, priority] = GetEffectiveDeadlineAndPriority(*handler, asset.GetType(), loadParams);
|
||||
|
||||
Reference in New Issue
Block a user