Skip to content

Stop the pool optimizer in stopWorkers() - #518

Closed
medjed02 wants to merge 1 commit into
meta:mainfrom
medjed02:stop-pool-optimizer
Closed

medjed02 wants to merge 1 commit into
meta:mainfrom
medjed02:stop-pool-optimizer

Conversation

@medjed02

Copy link
Copy Markdown

Summary:

stopWorkers() stopped every background worker except the pool optimizer, so the optimizer could still resize pools while shutDown() was serializing the cache. Now stopWorkers() stops it too.

Test Plan:

  • New SimplePoolOptimizationTest.StopWorkersStopsPoolOptimizer waits for the optimizer to run, calls stopWorkers() and checks that the strategy is not called again; it fails without the fix.
  • Full ctest passes.

stopWorkers() stops every background worker except the pool optimizer.
shutDown() relies on it before saving the cache state, so with the pool
optimizer enabled the optimizer thread can still resize pools while the
state is being serialized; the destructor has the same window until the
PoolOptimizer member itself is destroyed.

Test: a counting PoolOptimizeStrategy is no longer called after
stopWorkers() returns.
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Nov 11, 2026
@meta-codesync

meta-codesync Bot commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

@AlnisM has imported this pull request. If you are a Meta employee, you can view this in D131236874.

@meta-codesync meta-codesync Bot closed this in fc09cb9 Nov 11, 2026
@meta-codesync meta-codesync Bot added the Merged label Nov 11, 2026
@meta-codesync

meta-codesync Bot commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

@AlnisM merged this pull request in fc09cb9.

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

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant