UnattendedRetryTimer

UnattendedRetryTimer

#Overview

name: UnattendedRetryTimer

The value of this variable can be defined or overridden in .ini config files. 1 .ini config file referencing this setting variable.

It is referenced in 4 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of UnattendedRetryTimer is to control the delay between retry attempts when encountering errors during payload pulling in the Unreal Engine’s virtualization system. This setting is part of the error handling and retry mechanism for unattended operations.

The Unreal Engine subsystem that relies on this setting variable is the Virtualization system, specifically within the UE::Virtualization namespace and the FVirtualizationManager class.

The value of this variable is set in the ApplySettingsFromConfigFiles function of the FVirtualizationManager class. It reads the value from a configuration file using the ConfigFile.GetInt method.

UnattendedRetryTimer interacts with another variable called UnattendedRetryCount. Together, these variables control the retry behavior for unattended operations in the virtualization system.

Developers must be aware that:

  1. This variable is only effective when UnattendedRetryCount is set to a positive value.
  2. The value represents the delay in seconds between retry attempts.
  3. Setting this value appropriately can help manage network or system issues during virtualization operations.

Best practices when using this variable include:

  1. Set a reasonable delay based on the expected cause of failures. For intermittent network issues, a delay of several minutes might be appropriate.
  2. Consider the trade-off between quick retries and potential resource consumption. Longer delays might be preferable in some scenarios to avoid unnecessary system load.
  3. Use this in conjunction with UnattendedRetryCount to create an effective retry strategy for unattended operations.
  4. Monitor and log the retry attempts to track the effectiveness of the current settings and adjust as necessary.

#Setting Variables

#References In INI files

Location: <Workspace>/Engine/Config/BaseEngine.ini:1481, section: [Core.VirtualizationModule]

#References in C++ code

#Callsites

This variable is referenced in the following C++ source code:

#Loc: <Workspace>/Engine/Source/Developer/Virtualization/Private/VirtualizationManager.cpp:1220

Scope (from outer to inner):

file
namespace    UE::Virtualization
function     void FVirtualizationManager::ApplySettingsFromConfigFiles

Source code excerpt:


	{
		ConfigFile.GetInt(ConfigSection, TEXT("UnattendedRetryTimer"), UnattendedRetryTimer);
		ConfigFile.GetInt(ConfigSection, TEXT("UnattendedRetryCount"), UnattendedRetryCount);
		
		if (ShouldRetryWhenUnattended())
		{
			UE_LOG(LogVirtualization, Display, TEXT("\tUnattendedRetryTimer : %d retries every %d(s)"), UnattendedRetryCount, UnattendedRetryTimer);
		}
		else
		{
			UE_LOG(LogVirtualization, Display, TEXT("\tUnattendedRetries : disabled"));
		}
	}

#Loc: <Workspace>/Engine/Source/Developer/Virtualization/Private/VirtualizationManager.cpp:2101

Scope (from outer to inner):

file
namespace    UE::Virtualization
function     FVirtualizationManager::ErrorHandlingResult FVirtualizationManager::OnPayloadPullError

Source code excerpt:

				Result = EAppReturnType::Yes; // Attempt to retry the failed pull

				if (UnattendedRetryTimer > 0)
				{
					UE_LOG(LogVirtualization, Warning, TEXT("Waiting for %d seconds before trying to pull again..."), UnattendedRetryTimer);
					FPlatformProcess::SleepNoStats(static_cast<float>(UnattendedRetryTimer));
				}

				UnattendedFailureMsgCount++;
			}
		}

#Loc: <Workspace>/Engine/Source/Developer/Virtualization/Private/VirtualizationManager.h:143

Scope: file

Source code excerpt:

												spawn many errors in which case we try to group these errors into a single 'try' so 32 errors on 32
												threads would not immediately blow past a retry count of 30 for example. [Default=0]
 * UnattendedRetryTimer [int32]					If 'UnattendedRetryCount' is set to a positive value then this value sets how long (in seconds)
 *												the process should wait after a failure is encountered before retrying the pull. Depending on the
												likely cause of the failure you may want to set this value to several minutes. [Default=0]
 */

namespace UE::Virtualization
{
class FPullRequestCollection;

/** The default mode of filtering to use with package paths that do not match entries in UVirtualizationFilterSettings */
enum class EPackageFilterMode : uint8
{
	/** Packages will be virtualized by default and must be opted out by the use of UVirtualizationFilterSettings::ExcludePackagePaths */
	OptOut = 0,
	/** Packages will not be virtualized by default and must be opted in by the user of UVirtualizationFilterSettings::IncludePackagePaths */
	OptIn
};

/** Attempt to convert a string buffer to EPackageFilterMode */
bool LexTryParseString(EPackageFilterMode& OutValue, FStringView Buffer);

/** This is used as a wrapper around the various potential back end implementations. 
	The calling code shouldn't need to care about which back ends are actually in use. */
class FVirtualizationManager final : public IVirtualizationSystem
{
public:
	using FRegistedFactories = TMap<FName, IVirtualizationBackendFactory*>;
	using FBackendArray = TArray<IVirtualizationBackend*>;

	FVirtualizationManager();
	virtual ~FVirtualizationManager();

private:
	/* IVirtualizationSystem implementation */

	virtual bool Initialize(const FInitParams& InitParams) override;

	virtual bool IsEnabled() const override;
	virtual bool IsPushingEnabled(EStorageType StorageType) const override;

	virtual EPayloadFilterReason FilterPayload(const UObject* Owner) const override;

	virtual bool AllowSubmitIfVirtualizationFailed() const override;
	
	virtual bool PushData(TArrayView<FPushRequest> Requests, EStorageType StorageType) override;
	virtual bool PullData(TArrayView<FPullRequest> Requests) override;

	virtual EQueryResult QueryPayloadStatuses(TArrayView<const FIoHash> Ids, EStorageType StorageType, TArray<EPayloadStatus>& OutStatuses) override;

	virtual FVirtualizationResult TryVirtualizePackages(TConstArrayView<FString> PackagePaths, EVirtualizationOptions Options) override;

	virtual FRehydrationResult TryRehydratePackages(TConstArrayView<FString> PackagePaths, ERehydrationOptions Options) override;
	virtual ERehydrationResult TryRehydratePackages(TConstArrayView<FString> PackagePaths, uint64 PaddingAlignment, TArray<FText>& OutErrors, TArray<FSharedBuffer>& OutPackages, TArray<FRehydrationInfo>* OutInfo) override;

	virtual void DumpStats() const override;

	virtual FPayloadActivityInfo GetAccumualtedPayloadActivityInfo() const override;

	virtual void GetPayloadActivityInfo( GetPayloadActivityInfoFuncRef ) const override;

	virtual void GatherAnalytics(TArray<FAnalyticsEventAttribute>& Attributes) const override;

	virtual FOnNotification& GetNotificationEvent() override
	{
		return NotificationEvent;
	}
	

#Loc: <Workspace>/Engine/Source/Developer/Virtualization/Private/VirtualizationManager.h:350

Scope (from outer to inner):

file
namespace    UE::Virtualization
class        class FVirtualizationManager final : public IVirtualizationSystem

Source code excerpt:


	/** The how long (in seconds) to wait after payload pulling errors before retrying. Does nothing if 'UnattendedRetryCount' is disabled */
	int32 UnattendedRetryTimer = 0;

private:

	/** The name of the current project */
	FString ProjectName;