5964bb6 asyncrpc/client: Fix unix domain socket chdir race issues

Authored and Committed by Richard Purdie 2 years ago
    asyncrpc/client: Fix unix domain socket chdir race issues
    
    The connect_unix() call had a bug where if a relative path to a socket
    was passed (which the non-async client always does), and the current
    working directory was changed after the initial call, it would fail to
    reconnect if it became disconnected, since the socket couldn't be found
    relative to the new current working directory.
    
    To work around this, change the socket connection for UNIX domain
    sockets to be synchronous and change current working before connecting.
    This isn't ideal since the connection could block the entire event loop,
    but in practice this shouldn't happen since the socket are local files
    anyway.
    
    Help debugging and resolving from Joshua Watt.
    
    Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
    
        
file modified
+13 -9