Copilot commented on code in PR #2310:
URL: https://github.com/apache/nifi-minifi-cpp/pull/2310#discussion_r4618914373
##########
bootstrap/cli.py:
##########
@@ -119,8 +119,14 @@ def run_conan_install(minifi_options: MinifiOptions,
package_manager: PackageMan
print("Adding the nifi-conan remote failed")
return False
+ civetweb_defines = "'SOCKET_TIMEOUT_QUANTUM=200'"
+ if platform.system() != "Windows":
+ # use localtime_r/gmtime_r instead of the non-thread-safe
localtime/gmtime
+ civetweb_defines += ", 'REENTRANT_TIME'"
+ # access the stop flag atomically instead of as a plain volatile int,
which is a data race between mg_stop() and the civetweb threads
+ civetweb_defines += ", 'STOP_FLAG_NEEDS_LOCK'"
Review Comment:
Non-Windows Conan builds enable `STOP_FLAG_NEEDS_LOCK` but bypass
`cmake/CivetWeb.cmake`, so they miss the atomic-load backport. The [inspected
Conan Center
recipe](https://github.com/conan-io/conan-center-index/blob/530fbc14c26cec4c75ccf7943c4818d63dd52867/recipes/civetweb/all/conandata.yml#L11-L30)
has no patch for CivetWeb 1.16, leaving `STOP_FLAG_ASSIGN`'s plain `*f` read
racing with atomic stop-flag accesses during shutdown. Add a patched CivetWeb
Conan recipe and select it in `conanfile.py` so both dependency paths receive
the fix.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]