async icon indicating copy to clipboard operation
async copied to clipboard

possible race condition: Unable to open connection to server on socket

Open DavHau opened this issue 3 years ago • 1 comments

In a script where I'm doing this:

S="/$TMP/async_socket"
async -s="$S" server --start -j40
$async -s="$S" cmd -- bash -c "echo hello"

... I'm sometimes running into this:

Error: Unable to open connection to server on socket
sources-combined> Caused by IO error: No such file or directory (os error 2)

My guess is, that the async --start command doesn't ensure the socket file exists when exiting and only creates it shortly after. If cmd is issued too quickly, it will not find the socket and error out.

A sleep 1 after the start command, seems to resolve the issue. But this should better not be necessary.

DavHau avatar Mar 28 '22 14:03 DavHau

this happens almost every time for me. tried to async wait for the server to start, but it also fails to connect to the socket before the server comes up.

this makes it unusable for me.

sedlund avatar Aug 15 '24 09:08 sedlund