Closed owent closed 3 weeks ago
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 87.67%. Comparing base (
497eaf4
) to head (93ec062
). Report is 77 commits behind head on main.
- file iostream operations are not thread safe when multiple threads uses the same stream
file iostream operations are not thread safe when multiple threads uses the same stream(we got data race from std::basic_streambuf<CharT,Traits>::xsputn
when using tsan). But fwrite
and fflush
are thread safe when multiple threads uses the same FILE handle.
You are right, fwrite(data.data(), 1, data.size(), out.get());
and fputc('\n', out.get());
still have concurrency problems here. I have move the codes to append EOL in the caller.
@esigo Hi Ehsan. Any comments for the code review ?
Fixes #2674
Changes
fwrite
,fflush
to keep it thread-safety.OPENTELEMETRY_ATTRIBUTE_LIFETIME_BOUND
,OPENTELEMETRY_SANITIZER_NO_MEMORY
,OPENTELEMETRY_SANITIZER_NO_THREAD
,OPENTELEMETRY_SANITIZER_NO_ADDRESS
,OPENTELEMETRY_HAVE_BUILTIN
,OPENTELEMETRY_HAVE_FEATURE
,OPENTELEMETRY_HAVE_ATTRIBUTE
,OPENTELEMETRY_HAVE_CPP_ATTRIBUTE
For significant contributions please make sure you have completed the following items:
CHANGELOG.md
updated for non-trivial changes