Summary
FileIO2.WriteTextFileAsync retries on every IOException. DirectoryNotFoundException derives from IOException, so an absent target folder consumes the full 100-attempt, 100-millisecond retry window even though no attempt in that window can succeed.
Environment
- OS/version: Windows 11, .NET Framework 4.8.1
- Python version: not applicable
- Command/flags used: not applicable; reached through any caller of
UtilitiesCS.FileIO2.WriteTextFileAsync
- Data source or fixture:
UtilitiesCS/To Depricate/FileIO2.cs
Steps to Reproduce
- Call
FileIO2.WriteTextFileAsync with a folderpath that does not exist on disk.
- Observe that the writer factory throws
DirectoryNotFoundException on every attempt.
- Observe that the method spends roughly ten seconds in the retry loop before returning
false.
Expected Behavior
A failure that cannot be resolved by waiting should not consume the retry budget. The method should distinguish transient contention failures, for which retrying is the correct response, from structural failures such as a missing directory, and should return promptly on the latter.
Actual Behavior
The catch clause is catch (IOException ex). DirectoryNotFoundException is an IOException, so the loop performs all 100 attempts and awaits 99 delays before reporting failure.
Logs / Screenshots
Impact / Severity
Severity is Low because the one production caller that could reach the case guards against it: QuickFiler/Controllers/QfcHomeController.Metrics.cs calls Globals.FS.SpecialFolders.TryGetValue("MyDocuments", ...) before writing. The stall is therefore latent rather than observed.
Source
From: docs/features/potential/2026-08-31-narrow-fileio2-retryable-exception-set.md
Summary
FileIO2.WriteTextFileAsyncretries on everyIOException.DirectoryNotFoundExceptionderives fromIOException, so an absent target folder consumes the full 100-attempt, 100-millisecond retry window even though no attempt in that window can succeed.Environment
UtilitiesCS.FileIO2.WriteTextFileAsyncUtilitiesCS/To Depricate/FileIO2.csSteps to Reproduce
FileIO2.WriteTextFileAsyncwith afolderpaththat does not exist on disk.DirectoryNotFoundExceptionon every attempt.false.Expected Behavior
A failure that cannot be resolved by waiting should not consume the retry budget. The method should distinguish transient contention failures, for which retrying is the correct response, from structural failures such as a missing directory, and should return promptly on the latter.
Actual Behavior
The catch clause is
catch (IOException ex).DirectoryNotFoundExceptionis anIOException, so the loop performs all 100 attempts and awaits 99 delays before reporting failure.Logs / Screenshots
after {attempts} attempts.withattemptsequal to 100, once per call against a missing directory.Impact / Severity
Severity is Low because the one production caller that could reach the case guards against it:
QuickFiler/Controllers/QfcHomeController.Metrics.cscallsGlobals.FS.SpecialFolders.TryGetValue("MyDocuments", ...)before writing. The stall is therefore latent rather than observed.Source
From: docs/features/potential/2026-08-31-narrow-fileio2-retryable-exception-set.md