Consider making shutting down without joining the network thread safe in the client
Open
- Dominant language
- C++
- Stars
- 16.7k
- Forks
- 1.6k
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 126
Description
I've been able to use thread sanitizer (tsan) to detect such data races. Basically the main thread exits and destroys global variables used by the network thread, resulting in data races and heap-use-after-free's.
We've seen this a few times: #2841 , #2976. tsan is also reporting races in [networkOptions](https://github.com/apple/foundationdb/blob/5288033bcfe40c3ade97c8bf2d04cf31b3f16cb1/fdbclient/NativeAPI.actor.cpp#L71)
We should commit to getting tsan or helgrind or something to run with few/no false positives, and then regularly test shutting down without joining the network thread. This would also just be generally useful in libfdb_c.so development.
Contributor guide
Assessment
This issue has not been assessed yet.