Skip to content

Make a new sentinel variable for worker thread termination#50

Open
cottsay wants to merge 1 commit into
mainfrom
cottsay/worker-sentinel
Open

Make a new sentinel variable for worker thread termination#50
cottsay wants to merge 1 commit into
mainfrom
cottsay/worker-sentinel

Conversation

@cottsay

@cottsay cottsay commented May 7, 2026

Copy link
Copy Markdown
Member

The original approach here where the signal sentinel is re-used to broadcast termination to worker threads assumed that sig_atomic_t was thread safe, which is not correct. Rather than change sig_atomic_t to a type which is both thread-safe and can be set by signal-safe mechanisms, this change breaks the two apart and introduces a sentinel specifically for broadcasting termination signals to and from worker threads.

This closes a data race identified by tsan.

The original approach here where the signal sentinel is re-used to
broadcast termination to worker threads assumed that sig_atomic_t was
thread safe, which is not correct. Rather than change sig_atomic_t to a
type which is both thread-safe and can be set by signal-safe mechanisms,
this change breaks the two apart and introduces a sentinel specifically
for broadcasting termination signals to and from worker threads.

This closes a data race identified by tsan.
@cottsay cottsay requested a review from j-rivero May 7, 2026 19:01
@cottsay cottsay self-assigned this May 7, 2026
@cottsay cottsay added the bug Something isn't working label May 7, 2026
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 57.14286% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 55.54%. Comparing base (99a71b1) to head (d8a268b).

Files with missing lines Patch % Lines
src/createrepo-agent/command.c 57.14% 0 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #50      +/-   ##
==========================================
+ Coverage   55.47%   55.54%   +0.06%     
==========================================
  Files          22       22              
  Lines        2830     2832       +2     
  Branches      601      601              
==========================================
+ Hits         1570     1573       +3     
+ Misses        937      936       -1     
  Partials      323      323              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants