From 95712bc820a1d202ea1b80c56f19570249bd8667 Mon Sep 17 00:00:00 2001 From: daimond113 Date: Sat, 8 Feb 2025 01:12:09 +0100 Subject: [PATCH] fix: prevent deadlock in concurrent installs Previously, the code tried to acquire a lock every 1s while checking if it exists. This caused a deadlock, since the lock got acquired by the concurrent process after the installation had completed and the lock was released. --- toolchainlib/src/init.luau | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolchainlib/src/init.luau b/toolchainlib/src/init.luau index 0efedee..515dfc3 100644 --- a/toolchainlib/src/init.luau +++ b/toolchainlib/src/init.luau @@ -243,7 +243,7 @@ function installTool(tool: ToolId, installPath: pathfs.Path): number end task.wait(1) - isLocked, lockFileContents = tryAcquireLock() + isLocked, lockFileContents = pcall(fs.readFile, installLockFile) if not isLocked then return runTool(installPath) end