Plugging UNIX socket leaks
This patch is an effort to plug some leaks in our use of UNIX sockets.
A Heisenbug can occur if UNIX sockets are leaked:
The named UNIX socket used to listen for RenderThread connections,
usually at /tmp/android-$USER/qemu-gles-EMULATOR_PID,
will remain in the filesystem after it has been successfully
bound, even when the emulator closes all socket connections
carefully. That is the default named UNIX socket behavior.
In a system like a test-server, the EMULATOR-PID might
re-occur if PIDs loop past MAX_PID while the server is up.
In that case, the RenderServer will fail to bind and
listen to the (existing) named socket.
One could hide this problem by renaming the socket "uniquely",
but this is hopefully a proper solution.
Changes to be committed:
modified: distrib/android-emugl/host/libs/libOpenglRender/RenderServer.cpp
modified: distrib/android-emugl/host/libs/libOpenglRender/render_api.cpp
modified: distrib/android-emugl/shared/OpenglCodecCommon/SocketStream.cpp
modified: distrib/android-emugl/shared/OpenglCodecCommon/UnixStream.cpp
modified: distrib/android-emugl/shared/OpenglCodecCommon/UnixStream.h
modified: distrib/android-emugl/shared/emugl/common/sockets.cpp
Change-Id: I5d301ee55ee239725ea41bf5b3b31b80727dc330
6 files changed