]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
compat,msg: improve Windows socket checks
authorLucian Petrut <lpetrut@cloudbasesolutions.com>
Fri, 13 Nov 2020 12:18:32 +0000 (12:18 +0000)
committerLucian Petrut <lpetrut@cloudbasesolutions.com>
Wed, 18 Nov 2020 10:31:24 +0000 (10:31 +0000)
commit6ebd3d7b6f9a0c8c0d3377f38f96533fe537343c
tree065205fbff24d27b0707de68bd5fff298ea61910
parent833a09e8aedbf54ef71d578898a0b9aa1053b808
compat,msg: improve Windows socket checks

win_socketpair can fail with EADDRINUSE under load, which will
lead to an unhandled exception/crash as per this commit [1].

This change adds a retry, also ensuring that the right error code
gets propagated (the one returned by WSAGetLastError() instead of
the generic SOCKET_ERROR).

While at it, we're fixing the "win_socketpair" indentation and
addressing the SOCKET to int casts.

[1] https://github.com/ceph/ceph/commit/633805060a1002c86570fe50d099e0c1e223e2d7

Signed-off-by: Lucian Petrut <lpetrut@cloudbasesolutions.com>
src/common/compat.cc
src/msg/async/Event.cc