Skip to content

fix: start only the missing threads after a failed pool start - #467

Merged
sgerbino merged 1 commit into
cppalliance:developfrom
mvandeberg:pr/457-thread-pool-partial-start
Oct 23, 2026
Merged

sgerbino merged 1 commit into
cppalliance:developfrom
mvandeberg:pr/457-thread-pool-partial-start

Conversation

@mvandeberg

@mvandeberg mvandeberg commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

fix: start only the missing threads after a failed pool start

If a worker thread failed to start, the next post() started a full set of threads again, so the pool could run more threads than it was given. ensure_started() now starts only the missing ones.

The test uses a new test/unit/fault harness, a cut-down copy of Corosio's, that replaces pthread_create to make one thread fail. It runs on Linux only.

Closes #457

@cppalliance-bot

cppalliance-bot commented Oct 21, 2026 •

Copy link
Copy Markdown

An automated preview of the documentation is available at https://467.capy.prtest3.cppalliance.org/index.html

If more commits are pushed to the pull request, the docs will rebuild at the same URL.

2026-10-23 20:05:39 UTC

@cppalliance-bot

cppalliance-bot commented Oct 21, 2026 •

Copy link
Copy Markdown

GCOVR code coverage report https://467.capy.prtest3.cppalliance.org/gcovr/index.html
LCOV code coverage report https://467.capy.prtest3.cppalliance.org/genhtml/index.html
Coverage Diff Report https://467.capy.prtest3.cppalliance.org/diff-report/index.html

Build time: 2026-10-23 20:17:39 UTC

@codecov

codecov Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.47%. Comparing base (6c2998a) to head (d6dd7c1).
⚠️ Report is 1 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #467      +/-   ##
===========================================
+ Coverage    98.36%   98.47%   +0.10%     
===========================================
  Files          137      137              
  Lines         7293     7293              
===========================================
+ Hits          7174     7182       +8     
+ Misses         119      111       -8     
Flag Coverage Δ
linux 98.46% <ø> (+0.08%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
include/boost/capy/ex/thread_pool.hpp 100.00% <ø> (ø)
src/ex/thread_pool.cpp 100.00% <100.00%> (+0.66%) ⬆️

... and 10 files with indirect coverage changes


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6c2998a...d6dd7c1. Read the comment docs.

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

@mvandeberg
mvandeberg requested a review from sgerbino October 23, 2026 19:31
If a worker thread failed to start, the next post() started a full
set of threads again, so the pool could run more threads than it was
given. ensure_started() now starts only the missing ones.

The test uses a new test/unit/fault harness, a cut-down copy of
Corosio's, that replaces pthread_create to make one thread fail. It
runs on Linux only.

Closes cppalliance#457
@mvandeberg
mvandeberg force-pushed the pr/457-thread-pool-partial-start branch from 445edbc to d6dd7c1 Compare October 23, 2026 20:02
@sgerbino
sgerbino merged commit 158c009 into cppalliance:develop Oct 23, 2026
41 checks passed
@github-project-automation github-project-automation Bot moved this from Backlog to Done in Beast2 Oct 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

thread_pool: a failed worker start makes the next post start a second full set of threads

3 participants