Skip to content

fix mock NMR deregister race. - #319

Merged
Shankar Seal (shankarseal) merged 3 commits into
microsoft:mainfrom
shankarseal:shankarseal-fix-nmr-deregister-race
Aug 11, 2026
Merged

fix mock NMR deregister race.#319
Shankar Seal (shankarseal) merged 3 commits into
microsoft:mainfrom
shankarseal:shankarseal-fix-nmr-deregister-race

Conversation

@shankarseal

@shankarseal Shankar Seal (shankarseal) commented Aug 1, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fixes #318 an NMR client deregister can race with an incomplete NMR provider registration.

  • Deregistering modules always return STATUS_PENDING, matching Windows NMR behavior.
  • After attach succeeds, the binding is marked attached. If either module is already deregistering, it is marked LateBind and unbound immediately.
  • pending_bind_ops tracks accepted attach operations that have not completed. Each module also tracks all successfully attached bindings.
  • A module cannot be disposed until both pending bind operations are complete and its attached-binding list is empty.
  • Each binding starts unbind only once. After both detach callbacks complete, it is removed from both module lists and the global binding map.
  • add a concurrent register/deregister smoke test that loops provider and client registration/deregistration and prints executed iteration counts

Testing

  • run usersim_tests nmr tests.

Comment thread tests/nmr_test.cpp Outdated
@shankarseal
Shankar Seal (shankarseal) force-pushed the shankarseal-fix-nmr-deregister-race branch from 7d63080 to d87efd1 Compare August 5, 2026 23:26
Comment thread src/nmr_impl.cpp Outdated
Comment thread tests/nmr_test.cpp
Shankar Seal (from Dev Box) and others added 3 commits August 10, 2026 20:29
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 6e257781-cd5a-4ae3-9943-0c217ccad54e
@shankarseal
Shankar Seal (shankarseal) force-pushed the shankarseal-fix-nmr-deregister-race branch from 9fd7c6d to 8582087 Compare August 11, 2026 03:29
@shankarseal
Shankar Seal (shankarseal) merged commit dcff48c into microsoft:main Aug 11, 2026
9 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in eBPF for Windows Triage Aug 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

NmrDeregisterClient can hang if it races with NmrRegisterProvider.

3 participants