diff --git a/changelog.md b/changelog.md index ee1758b..2afb29f 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,12 @@ # Changelog +## 2026-03-05 - 4.1.19 - fix(mod_fs) +use synchronous rm to avoid XFS metadata corruption when removing directories + +- Replaced async fs.promises.rm with synchronous fs.rmSync in removeDirectory to avoid observed XFS metadata corruption affecting sibling entries under libuv thread-pool and signal pressure +- Retains previous options: recursive, force, maxRetries, retryDelay +- Adds inline comment documenting the rationale for using a synchronous removal + ## 2026-03-05 - 4.1.18 - fix(mod_compiler) add diagnostic logging of output directory states after compilation and after import-path rewriting to aid debugging diff --git a/ts/00_commitinfo_data.ts b/ts/00_commitinfo_data.ts index 16cf670..acd4adf 100644 --- a/ts/00_commitinfo_data.ts +++ b/ts/00_commitinfo_data.ts @@ -3,6 +3,6 @@ */ export const commitinfo = { name: '@git.zone/tsbuild', - version: '4.1.18', + version: '4.1.19', description: 'A tool for compiling TypeScript files using the latest nightly features, offering flexible APIs and a CLI for streamlined development.' } diff --git a/ts/mod_fs/classes.fshelpers.ts b/ts/mod_fs/classes.fshelpers.ts index 8ec2bce..d161a7b 100644 --- a/ts/mod_fs/classes.fshelpers.ts +++ b/ts/mod_fs/classes.fshelpers.ts @@ -122,10 +122,13 @@ export class FsHelpers { } /** - * Remove a directory recursively + * Remove a directory recursively. + * Uses synchronous rm to avoid XFS metadata corruption observed with + * async fs.promises.rm affecting sibling directory entries on the + * libuv thread pool under signal pressure. */ public static async removeDirectory(dirPath: string): Promise { - await fs.promises.rm(dirPath, { recursive: true, force: true, maxRetries: 3, retryDelay: 100 }); + fs.rmSync(dirPath, { recursive: true, force: true, maxRetries: 3, retryDelay: 100 }); } /**