Repository navigation
Document Unix named mutex scope and storage changes - #56400
Conversation
There was a problem hiding this comment.
Copilot wasn't able to review any files in this pull request. Check if the Files changed in this pull request are included in default exclusions.
Co-authored-by: BillWagner <[email protected]>
|
Thanks for writing this up. I tested the storage-location paragraph ("New behavior", line 22) against runtime 8.0.32 on Linux (mcr.microsoft.com/dotnet/sdk:8.0.426, linux-x64, Debian 12), with XDG_RUNTIME_DIR unset unless noted. Two statements don't match what I observed:
The failures are System.IO.IOException: The system cannot open the device or file specified. : 'NuGet-Migrations' during SDK first run. That's common in CI, where containers often run with docker run -u Suggested wording for line 22: ▎ The runtime stores user-scoped mutex backing files in $TMPDIR on platforms where it's a per-user directory (such as macOS). Otherwise, it uses $XDG_RUNTIME_DIR if set; if not, it uses a directory under the current user's home directory as defined in the user database (/etc/passwd), not $HOME. And an addition to "Recommended action": ▎ If your process runs as a UID with no user database entry, which is common in containers started with docker run -u or Kubernetes runAsUser, named mutex creation fails. Set XDG_RUNTIME_DIR to a writable directory owned by that user, or create a user account for that UID in the image. I've only tested 8.0.32 on Linux; 9.0, 10.0 and 11.0 may differ. |
Co-authored-by: Genevieve Warren <[email protected]>
|
@jkoritzinsky Can you review #56400 (comment) and let us know if anything in this PR should be updated? Thanks. |
|
@BillWagner all of the recommendations there are correct. I'd recommend taking them. In particular the last recommendation was something I was going to recommend as another workaround. All of the feedback from that comment should be integrated into the notice. |
|
@copilot Incorporate all the recommendations for workarounds from #56400 (comment) with note on #56400 (comment). |
Updated the notice with the storage-path corrections and the workaround for UIDs without a user-database entry. The changes are local and uncommitted for review. |
Co-authored-by: BillWagner <[email protected]>
Unix named mutexes now default to user scope, and user-scoped mutex files use user-only directories instead of
/tmp. The change applies to .NET 8.0.32, 9.0.21, 10.0.13, and 11.0-rc2.For applications that require global scope, the runtime configuration option can restore the previous default:
{ "runtimeOptions": { "configProperties": { "System.Threading.Mutex.UnsafeDefaultMutexScopeGlobal": true } } }Internal previews
Build report