-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Internal Code
-
None
-
Fully Compatible
-
ALL
-
v5.0
-
Service Arch 2022-1-24
-
70
-
1
SERVER-62571 introduced a few changes to ThrowOnNetworkErrorInEnsureSync, one of the tests in transport_layer_asio_test.cpp, to fix a data-race in the unit-test. One of the changes was introducing a scope-guard, that will set a barrier upon returning from a lambda (defined here):
... unittest::Barrier barrier(2); ConnectionThread connectThread(tf.tla().listenerPort(), [&](ConnectionThread& conn) { ON_BLOCK_EXIT([&] { barrier.countDownAndWait(); }); // This line is causing the build failure. // Linger timeout = 0 causes a RST packet on close. struct linger sl = {1, 0}; if (setsockopt(conn.socket().rawFD(), SOL_SOCKET, SO_LINGER, reinterpret_cast<SetsockoptPtr>(&sl), sizeof(sl)) != 0) { auto err = make_error_code(std::errc{errno}); LOGV2_ERROR(6060300, "setsockopt", "error"_attr = err.message()); } }); ...
Building transport_layer_asio_test.cpp with "Enterprise Windows C++20 DEBUG" is failing after SERVER-62571 is merged. Removing the scope-guard, however, fixes the build-failure. This ticket should resolve the issue by either fixing the issue with scope-guards and the new Windows build system, or replacing the scope-guard with an alternative.
- related to
-
SERVER-62763 Fix data-type used for passing options to `setsockopt`
- Closed