Retry failed FwpmTransactionBegin #3659
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
WFP allows only 1 active transaction at a time per WFP session. This leads to errors in multi-threaded scenarios where threads simultaneously try to load and attach ebpf program types supported by the NetEbpfExt extension. In certain timing sensitive instances, such multi-threaded scenarios cause NetEbpfExt to attempt to create a new WFP transaction while a previous transaction is still in progress.
This PR adds time-bounded retry logic to the call to
FwpmTransactionBegin
call to allow for an already-in-progress transaction (if any) to complete.Testing
Fix verified locally (100% repro) as well as multiple, back-to-back CI/CD runs on private self-hosted runner.
Do any existing tests cover this change? Are new tests needed?
Issue uncovered by existing tests. No new tests needed.
Documentation
No Documentation changes needed.
Installation
Is there any installer impact for this change?
No Installer impact.
Fixes #3602 #3607