Skip to content

task: add ThreadSanitizer CI profile, focused test selection, and fixes for race-safe stream completion - #264

Merged
MisterVVP merged 1 commit into
mainfrom
dev-add-threadsanitizer-validation-profile-urdmrx
Oct 5, 2026
Merged

MisterVVP merged 1 commit into
mainfrom
dev-add-threadsanitizer-validation-profile-urdmrx

Conversation

@MisterVVP

@MisterVVP MisterVVP commented Oct 5, 2026 •

Copy link
Copy Markdown
Owner

Motivation

  • Introduce a focused ThreadSanitizer (TSan) profile to detect SDK-owned concurrency races without noise from third-party runtimes.
  • Run the profile in CI and provide a reproducible developer script and documentation to make targeted race detection easy to run locally.

Description

  • Add a new GitHub Actions job thread-sanitizer in .github/workflows/ci.yml that installs clang and runs the TSan profile via ./scripts/run_thread_sanitizer.sh.
  • Add scripts/run_thread_sanitizer.sh, which configures a Clang TSan build (-fsanitize=thread) for a focused set of test executables and invokes ctest --test-dir <build> -L tsan.
  • Add documentation docs/thread-sanitizer.md describing the profile, how to run it, the selected targets, and the rationale for not using suppressions.
  • Label a selected subset of tests with LABELS "tsan" in tests/CMakeLists.txt to control which tests the focused profile runs.
  • Fix thread-safety issues in streaming code by replacing local completion state with a shared SynchronousStreamCompletion struct (mutex, condition variable, response, completed flag) in src/http/http_client_streaming.cpp.
  • Adjust an integration test (tests/integration/http_json_streaming_integration_test.cpp) to consistently lock the same mutex when notifying and waiting, removing an unused extra mutex to avoid potential races.

@MisterVVP MisterVVP added the codex Automatic label added by codex agent. Should not be used label Oct 5, 2026 — with ChatGPT Codex Connector
@MisterVVP MisterVVP added AI agent AI agent contribution maintenance and removed codex Automatic label added by codex agent. Should not be used labels Oct 5, 2026
@MisterVVP MisterVVP changed the title Add ThreadSanitizer CI profile, focused test selection, and fixes for race-safe stream completion task: add ThreadSanitizer CI profile, focused test selection, and fixes for race-safe stream completion Oct 5, 2026
@MisterVVP

Copy link
Copy Markdown
Owner Author

@codex review this PR

@MisterVVP
MisterVVP marked this pull request as ready for review October 5, 2026 08:44
@MisterVVP MisterVVP self-assigned this Oct 5, 2026
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

Reviewed commit: ba5a3350da

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@MisterVVP
MisterVVP merged commit 7335f36 into main Oct 5, 2026
22 checks passed
@MisterVVP
MisterVVP deleted the dev-add-threadsanitizer-validation-profile-urdmrx branch October 5, 2026 10:00
@MisterVVP MisterVVP mentioned this pull request Oct 8, 2026
4 of 5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI agent AI agent contribution maintenance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Maintenance]: Add a targeted ThreadSanitizer CI profile for concurrency-sensitive code

1 participant