fix: remove unused MIN_THREADS and CPU_THRESHOLD variables#489
Open
xlyoung wants to merge 1 commit into
Open
Conversation
Remove MIN_THREADS (STRANDS_WORKFLOW_MIN_THREADS) and CPU_THRESHOLD (STRANDS_WORKFLOW_CPU_THRESHOLD) variables from workflow.py. - MIN_THREADS was stored in self.min_workers but never used. Python's ThreadPoolExecutor creates threads lazily on demand, so min_workers has no effect. - CPU_THRESHOLD was defined with a comment about scaling down but was never referenced anywhere in the codebase. No CPU monitoring was implemented. Also removes the unused min_workers parameter from TaskExecutor.__init__ since it was only passed through to the unused self.min_workers attribute. Fixes strands-agents#327
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The workflow tool defines three thread pool configuration variables, but two of them have no effect:
self.min_workersbut never referenced again. Python'sThreadPoolExecutordoesn't supportmin_workers— threads are created lazily on demand.Only MAX_THREADS actually controls the thread pool size.
Fix
MIN_THREADSandCPU_THRESHOLDvariablesmin_workersparameter fromTaskExecutor.__init__self.min_workersattributeTesting
All 32 existing workflow tests pass with no changes needed.
Fixes #327