mirror of
https://github.com/cirruslabs/tart.git
synced 2026-10-18 03:53:56 +02:00
fix(control-socket): use .path instead of .path() for stale socket cleanup
Use URL's .path property instead of .path() method when removing stale
control sockets in ControlSocket.run(). The .path() method returns only
the relative component ('control.sock') while .path resolves to the
full absolute path. Since the cwd change happens after the cleanup,
removeItem silently failed to find the socket.
Add unit tests verifying controlSocketURL resolves correctly for both
absolute cleanup and relative binding use cases.
Fixes: https://github.com/cirruslabs/tart/issues/1220
This commit is contained in:
committed by
Nikolay Edigaryev
parent
5287b597a1
commit
3f1624e31a
@@ -19,7 +19,7 @@ class ControlSocket {
|
||||
func run() async throws {
|
||||
// Remove control socket file from previous "tart run" invocations,
|
||||
// if any, otherwise we may get the "address already in use" error
|
||||
try? FileManager.default.removeItem(atPath: controlSocketURL.path())
|
||||
try? FileManager.default.removeItem(atPath: controlSocketURL.path)
|
||||
|
||||
// Change the current working directory to a VM's base directory
|
||||
// to work around Unix domain socket 104 byte limitation [1]
|
||||
|
||||
Reference in New Issue
Block a user