Proper cleanup for deployed process signaler#259
Merged
Tyrrrz merged 2 commits intoTyrrrz:masterfrom Sep 19, 2024
Merged
Conversation
Tyrrrz
reviewed
Sep 14, 2024
…empFileName GetTempFileName create 0 size temp files to ensure availability of the generated temp filename, which are not removed when the WindowsSignaler is disposed. Instead we simply create our unique temp filenames using UUID, and thus we only create the actual temp (.exe) file that we actually need.
Tyrrrz
reviewed
Sep 19, 2024
Owner
|
Thanks! |
heqianwang
pushed a commit
to workleap/wl-leap-local-dev
that referenced
this pull request
Mar 20, 2025
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [CliWrap](https://github.com/Tyrrrz/CliWrap) | nuget | patch | `3.6.6` -> `3.6.7` | --- ### Release Notes <details> <summary>Tyrrrz/CliWrap (CliWrap)</summary> ### [`v3.6.7`](https://github.com/Tyrrrz/CliWrap/releases/tag/3.6.7) [Compare Source](Tyrrrz/CliWrap@3.6.6...3.6.7) #### What's Changed - Bump the nuget group with 6 updates by [@​dependabot](https://github.com/dependabot) in Tyrrrz/CliWrap#245 - Bump the nuget group with 2 updates by [@​dependabot](https://github.com/dependabot) in Tyrrrz/CliWrap#252 - Bump the nuget group with 3 updates by [@​dependabot](https://github.com/dependabot) in Tyrrrz/CliWrap#255 - Proper cleanup for deployed process signaler by [@​xpherism](https://github.com/xpherism) in Tyrrrz/CliWrap#259 - Bump the nuget group with 4 updates by [@​dependabot](https://github.com/dependabot) in Tyrrrz/CliWrap#260 - Use `Encoding.Default` instead of `Console.OutputEncoding` as the default encoding by [@​Tyrrrz](https://github.com/Tyrrrz) in Tyrrrz/CliWrap#262 #### New Contributors - [@​dependabot](https://github.com/dependabot) made their first contribution in Tyrrrz/CliWrap#245 - [@​xpherism](https://github.com/xpherism) made their first contribution in Tyrrrz/CliWrap#259 **Full Changelog**: Tyrrrz/CliWrap@3.6.6...3.6.7 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR is behind base branch, or PR is renamed to start with "rebase!". 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
This was referenced Apr 16, 2026
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.
On Windows calling GetTempFileName results in a 0 size unique file created to ensure the availability of the temp file name. These are not automatically deleted as per documentation (the OS probably will do some cleanup from time to time thou).
https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-gettempfilenamew
Using .NET 7 and below there is limit of 65535 unique temp files names as GetTempFileNameW is used (this limitation is removed in .NET 8+) If we look and the .NET 8 implementation (which I'm guessing follows the WIN32 implementation somewhat), a loop is use to find a unique temp filename, which at least as observed for .NET 6 on Windows, will result in very high CPU utilization when nearing the unique temp file name limit as the numbers of name collision becomes very high.
https://github.com/dotnet/runtime/blob/v8.0.8/src/libraries/System.Private.CoreLib/src/System/IO/Path.Windows.cs
To avoid problems with temp file leaking we simply generate our own temp filename using
GetTempPath()and a UUID.Closes #258