Skip to content
Commit 3122529f authored by Tycho Andersen's avatar Tycho Andersen Committed by Pavel Emelyanov
Browse files

unix: wait for listen() as well as bind()



We need to wait for listen() as well as bind() for internal unix sockets, or we
can race like this:

(00.135950)      1: Opening standalone socket (id 0xb ino 0x9422f peer 0)
(00.135974)    353: Error (sk-unix.c:701): Can't connect 0x947c4 socket: Connection refused
(00.136390)      1: Error (cr-restore.c:1228): 353 exited, status=1
(00.136407)      1:  Putting 0x9422f into listen state

(where 0x9422f is the peer for 0x947c4)

This race was pretty rare for me, but I've run 1000 tests and it didn't
happen so hopefully this patch fixes it :)

Signed-off-by: default avatarTycho Andersen <tycho.andersen@canonical.com>
Acked-by: default avatarAndrew Vagin <avagin@odin.com>
Signed-off-by: default avatarPavel Emelyanov <xemul@parallels.com>
parent 445dbd9d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment