Skip to content

Commit ded1336

Browse files
committed
fix race in HostEchoServer.exit()
There is a race between the exit() function closing the host vsock UDS and run() function which polls the socket using select(). If the select() runs right after the socket is closed but before the thread is signalled to stop, we get a BadFd errno, causing a false test failure. This is the root cause of intermittent failures in check_guest_connections affecting tests like test_vsock.py and test_snapshot_basic.py Signed-off-by: alindima <[email protected]>
1 parent 705370c commit ded1336

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/framework/utils_vsock.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,10 @@ def exit(self):
8585
This method can be called from any thread. Upon returning, the
8686
echo server will have shut down.
8787
"""
88-
self.sock.close()
89-
utils.run_cmd("rm -f {}".format(self.path))
9088
self.exit_evt.set()
9189
self.join()
90+
self.sock.close()
91+
utils.run_cmd("rm -f {}".format(self.path))
9292

9393

9494
class HostEchoWorker(Thread):

0 commit comments

Comments
 (0)