Skip to content

DownloadLatestAlLanguageExtension concurrency mutex exception#4127

Open
lktraser wants to merge 6 commits into
microsoft:mainfrom
lktraser:lkn/mutexaccess
Open

DownloadLatestAlLanguageExtension concurrency mutex exception#4127
lktraser wants to merge 6 commits into
microsoft:mainfrom
lktraser:lkn/mutexaccess

Conversation

@lktraser

Copy link
Copy Markdown
Contributor

❔What, Why & How

Problem
On build servers running concurrent pipeline agents, DownloadLatestAlLanguageExtension sporadically throws:
Exception calling ".ctor" with "2" argument(s): "Access to the path 'DownloadAlLanguageExtension' is denied."

Root cause: named mutexes created without an explicit security descriptor are placed in a session-scoped namespace and inherit the creator's DACL. When Azure DevOps agents run as a domain user or service account, the pipeline host performs Windows impersonation that lands each agent job in a different logon session. The second process attempting to open the mutex gets access denied — not because of file permissions, but because the kernel object was created in another session's namespace. This is the same class of problem originally reported in #1088 and again in #3164.

Fix
Prefix mutex name with Global\ — places it in the global kernel namespace, shared across all logon sessions
Attach a MutexSecurity ACL granting FullControl to Everyone (via WellKnownSidType.WorldSid) so any process can open the existing mutex regardless of session
Tested

Verified on a Windows Server build host with multiple Azure DevOps agents running concurrently under a domain user service account.

✅ Checklist

  • [ X] Add tests (Tests / LinuxTests) - existing tests should cover this
  • [ X] Update ReleaseNotes.txt
  • [ X] Add telemetry - no new functionality so no new telemetry

@lktraser lktraser requested a review from a team as a code owner April 23, 2026 05:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant