Test: retry MddBootstrapInitialize on transient State Repository error (AB#62489699) - #6596
Conversation
…ndency error (AB#62489699) The Test_x86_Windows.10.Professional.22H2_releasex86 stage in the Foundation PR pipeline intermittently fails in TAEF ClassSetup with MddBootstrapInitialize returning STATEREPOSITORY_E_DEPENDENCY_NOT_RESOLVED (0x80670016). On slow/loaded agents the State Repository can still be indexing the just-installed DDLM package when the bootstrapper enumerates it; the same SHA passes on retry, confirming a transient race rather than a product regression. SetupBootstrapWithVersion now retries MddBootstrapInitialize with a bounded backoff (up to 10 attempts, 300ms apart) only when it returns 0x80670016. Any other HRESULT is verified immediately and is not masked.
…scription (AB#62489699)
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
| 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 |
There was a problem hiding this comment.
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?
Howard Kapustein (DrusTheAxe)
left a comment
There was a problem hiding this comment.
The described scenario doesn't make sense. There may be a problem but it's not what's described. Please clarify what deployment actions led to the described transient error.
| } | ||
|
|
||
| VERIFY_SUCCEEDED(MddBootstrapInitialize(version_MajorMinor, nullptr, minVersion)); | ||
| // AB#62489699: On slow/loaded test agents (observed on the x86 Win10 22H2 stage) the State |
There was a problem hiding this comment.
What is AB#62489699?
If this is a reference to issue # 62489699 in the internal Microsoft tracker, use the task.ms URL e.g.
// https://task.ms/62489699 blah blah blah
Problem
The Test_x86_Windows.10.Professional.22H2_releasex86 stage in the Foundation PR pipeline intermittently fails in TAEF ClassSetup with MddBootstrapInitialize returning STATEREPOSITORY_E_DEPENDENCY_NOT_RESOLVED (0x80670016). The same SHA passes on retry, and only this one x86 Win10 22H2 stage is affected, pointing to a transient timing race rather than a product regression.
Root cause
SetupPackages installs the DDLM package via AddPackageAsync().get() (which completes), then immediately calls MddBootstrapInitialize. On a slow/loaded agent the State Repository can still be indexing the just-registered DDLM package when the bootstrapper enumerates it, so no fitting DDLM is found and it throws STATEREPOSITORY_E_DEPENDENCY_NOT_RESOLVED. This clears on its own once indexing catches up.
Fix
SetupBootstrapWithVersion now retries MddBootstrapInitialize with a bounded backoff (up to 10 total attempts, 300ms apart) only when it returns 0x80670016. Any other HRESULT is verified immediately via VERIFY_SUCCEEDED and is not masked. Test-harness-only change; no product bootstrap code is touched.