-
Notifications
You must be signed in to change notification settings - Fork 460
Test: retry MddBootstrapInitialize on transient State Repository error (AB#62489699) #6596
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -130,7 +130,29 @@ namespace Test::Bootstrap | |
| TP::WindowsAppRuntimeMain::c_PackageNamePrefix)); | ||
| } | ||
|
|
||
| VERIFY_SUCCEEDED(MddBootstrapInitialize(version_MajorMinor, nullptr, minVersion)); | ||
| // AB#62489699: On slow/loaded test agents (observed on the x86 Win10 22H2 stage) the State | ||
| // Repository can still be indexing the DDLM package we just installed when the bootstrapper | ||
| // enumerates it, so MddBootstrapInitialize fails with STATEREPOSITORY_E_DEPENDENCY_NOT_RESOLVED | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's not how it works. Indexing happens as part of Stage, Add and Register if the package is not on the machine. If you "just installed" a package (using any of the above) then, by definition the package has been indexed. See There is no Install – it’s ‘Stage’ and ‘Register’ for (some) more information. Can you explain what deployment operation(s) you're doing before this, where you think you're seeing a transient failure? |
||
| // (0x80670016). This is transient and clears once indexing completes, so retry with a bounded | ||
| // backoff. Only this specific HRESULT is retried; any other failure is verified immediately and | ||
| // is not masked. | ||
| constexpr HRESULT c_stateRepositoryDependencyNotResolved{ static_cast<HRESULT>(0x80670016) }; // STATEREPOSITORY_E_DEPENDENCY_NOT_RESOLVED | ||
| constexpr UINT32 c_maxInitAttempts{ 10 }; | ||
| constexpr DWORD c_initRetryDelayMs{ 300 }; | ||
| HRESULT initHR{ E_FAIL }; | ||
| for (UINT32 attempt = 1; attempt <= c_maxInitAttempts; ++attempt) | ||
| { | ||
| initHR = MddBootstrapInitialize(version_MajorMinor, nullptr, minVersion); | ||
| if (SUCCEEDED(initHR) || (initHR != c_stateRepositoryDependencyNotResolved) || (attempt == c_maxInitAttempts)) | ||
| { | ||
| break; | ||
| } | ||
| WEX::Logging::Log::Comment(WEX::Common::String().Format( | ||
| L"MddBootstrapInitialize returned STATEREPOSITORY_E_DEPENDENCY_NOT_RESOLVED (0x%X); State Repository likely still indexing the just-installed package. Attempt %u/%u. Retrying after %ums.", | ||
| initHR, attempt, c_maxInitAttempts, c_initRetryDelayMs)); | ||
| Sleep(c_initRetryDelayMs); | ||
| } | ||
| VERIFY_SUCCEEDED(initHR); | ||
| s_bootstrapDll = std::move(bootstrapDll); | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is
AB#62489699?If this is a reference to issue # 62489699 in the internal Microsoft tracker, use the task.ms URL e.g.