Skip to content

fix: switch to promises to prevent locking on windows os#5

Merged
GangGreenTemperTatum merged 1 commit intomainfrom
fix/windows-os-behavior-fsspec
Oct 23, 2025
Merged

fix: switch to promises to prevent locking on windows os#5
GangGreenTemperTatum merged 1 commit intomainfrom
fix/windows-os-behavior-fsspec

Conversation

@GangGreenTemperTatum
Copy link
Owner

@GangGreenTemperTatum GangGreenTemperTatum commented Sep 15, 2025

fix: switch to promises to prevent locking on windows os

Key Changes:

Changed:

  1. Replaced synchronous imports with async versions:
    - accessSync, readdirSync, statSync → access, readdir, stat from fs/promises
  2. Updated pathExists function:
    - Now returns Promise instead of boolean
    - Uses await access() instead of accessSync()
  3. Refactored directory scanning:
    - scanDirectory is now async and returns Promise
    - Uses await readdir() instead of readdirSync()
    - Uses await stat() instead of statSync()
    - Added await for recursive calls to scanDirectory()
  4. Updated function calls:
    - Added await when calling pathExists()
    - Added await when calling scanDirectory()

@Sytten @amrelsagaei could i ask if you had 5 mins for a quick PR review on this please? tested and works in my VM but i don't have Windows hardware


Generated Summary

  • Converted file system operations from synchronous to asynchronous by replacing "fs" functions with corresponding functions from "fs/promises".
  • Updated the pathExists function to use async/await, ensuring proper handling of file existence checks.
  • Modified getWorkspaceFiles to utilize the new async functions for directory reading and file statistics, including within the recursive scan of directories.
  • Adjusted conditional checks and logging to reflect asynchronous status and results.

This summary was generated with ❤️ by rigging

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Refactors file system operations from synchronous to asynchronous to prevent file locking issues on Windows OS.

  • Replaced synchronous fs functions (accessSync, readdirSync, statSync) with async alternatives from fs/promises
  • Updated pathExists, scanDirectory functions to be async and return promises
  • Added proper await keywords for all async function calls throughout the file

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@GangGreenTemperTatum GangGreenTemperTatum merged commit 27ffe19 into main Oct 23, 2025
6 checks passed
@GangGreenTemperTatum GangGreenTemperTatum deleted the fix/windows-os-behavior-fsspec branch October 23, 2025 22:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🚨 [BUG] - Windows OS performance with fsspec file locking

2 participants