Fix filesystem server crashes on invalid paths with graceful validation #2603
+25
−13
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.
Description
This PR fixes filesystem server crashes when invalid or inaccessible paths are configured by implementing graceful path validation. The server now logs warnings for problematic paths at startup but continues running, allowing operations to retry at runtime when storage becomes available.
Server Details
Motivation and Context
Addresses GitHub issues #2113 and #2483. The filesystem server would crash immediately if any configured directory path was invalid, inaccessible, or pointed to a file instead of a directory. This was problematic for users with:
The original behavior provided a poor user experience and made the server fragile in dynamic storage environments.
How Has This Been Tested?
Breaking Changes
No breaking changes. This is backwards compatible - existing configurations continue to work. The only change is that invalid paths now generate warnings instead of crashes.
Types of changes
Checklist
Additional context
Implementation Details:
Promise.all
for better performanceDesign Philosophy:
The new approach is optimistic about dynamic storage - we include paths that might become valid directories later while permanently excluding things that can never be directories. This balances robustness with usability for modern storage environments.