DownloadLatestAlLanguageExtension concurrency mutex exception#4127
Open
lktraser wants to merge 6 commits into
Open
DownloadLatestAlLanguageExtension concurrency mutex exception#4127lktraser wants to merge 6 commits into
lktraser wants to merge 6 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
❔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
Tests/LinuxTests) - existing tests should cover this