You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
…in Webserver
Summary:
When building the code with Clang 11 on Linux, we get an assertion failure in ~CDSAttacher when it is trying to call cds::threading::Manager::detachThread(). This is because the corresponding thread-local storage inside of libcds's thread-specific data manager has already been destroyed for this thread. The relative order of calls to the "destructor" function passed to pthread_key_create (which is how libcds manages its thread-local storage in pthread_manager.h) and ~CDSAttacher in our webserver.cc file (for a thread managed by the Squeasel web server) is apparently not well defined and depends on the compiler.
The fix is to simply avoid calling cds::threading::Manager::detachThread() for the web server handler threads, as the necessary cleanup will still be done by the "destructor" function of the thread-local storage inside libcds. There is probably some value in calling detachThread() from code that does not belong to a static object's destructor, but it is probably not worth doing that for Squeasel web server's threads just for sanity checking, because that would complicate things unnecessarily.
Test Plan:
Jenkins
Build YugabyteDB with Clang 11 on Linux (we will support that compiler officially soon) and verify that a mini-cluster test such as kv_table-test succeeds.
Reviewers: sergei
Reviewed By: sergei
Subscribers: ybase, bogdan
Differential Revision: https://phabricator.dev.yugabyte.com/D9792
The text was updated successfully, but these errors were encountered: