Repository navigation
fix(execution): size activity slots and the blocking pool from the container's limits [FND-4646] - #4822
Open
cmgrote wants to merge 1 commit into
Open
fix(execution): size activity slots and the blocking pool from the container's limits [FND-4646]#4822cmgrote wants to merge 1 commit into
cmgrote wants to merge 1 commit into
Conversation
…ntainer's limits [FND-4646] The worker defaulted to 100 activity slots and sized the sdk-blocking pool from os.cpu_count(), the node's cores. A 1-CPU pod on a 64-core node got 100 slots and 32 blocking threads, oversubscribing CPU and memory and starving the heartbeat loop. - sdk-blocking pool: min(32, available_cpus() + 4). - Activity slots: TEMPORAL_MAX_CONCURRENT_ACTIVITIES still wins; unset, min(100, 10 x CPUs, memory limit // 256 MiB), never below 1. - The worker logs the slot count and its inputs at startup. Claude-Session: https://claude.ai/code/session_01AbKqGaeq2q955aBdyQCbxg
cmgrote
requested review from
Aryamanz29,
OnkarVO7,
atlan-ci and
vaibhavatlan
as code owners
November 10, 2026 02:21
Contributor
📜 Docstring Coverage ReportRESULT: PASSED (minimum: 75.0%, actual: 80.0%) Detailed Coverage Report |
This branch has not been deployed
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.
Changelog
TEMPORAL_MAX_CONCURRENT_ACTIVITIESis unset or blank, the worker's activity-slot default ismin(100, 10 × CPUs, memory limit ÷ 256 MiB), never below 1. It used to be a fixed 100. CPUs are the container's CFS quota, rounded down (available_cpus()). The memory limit is the cgroup's, falling back toK8S_POD_MEMORY_LIMIT. With no known memory limit, only the CPU term applies. 100 stays the cap, so no pod gets more slots than before. Example: a 1-CPU, 2 GiB pod gets 8 slots. The env var still overrides.sdk-blocking-pool behindrun_in_threadis nowmin(32, available_cpus() + 4)wide. It used to beos.cpu_count() + 4, so a 1-CPU pod on a 64-core node got 32 threads.Activity slots: N (...), naming either the env var or the CPU and memory inputs it derived the value from.configuration.md(newTEMPORAL_MAX_CONCURRENT_ACTIVITIESrow),upgrade-guide-v3.md(behaviour-change note),env-vars.md(K8S_POD_MEMORY_LIMITnow also feeds the slot default),concepts/tasks.mdand ADR-0010 (pool width).Additional context (e.g. screenshots, logs, links)
execution/settings.py. If sizing telemetry later shows a different per-activity footprint, change them there.mainand pass on this branch. Locally, 1786 tests pass acrosstests/unit/execution,tests/unit/runtime,tests/unit/observability/test_cgroup.pyandtests/unit/test_app_config.py. Pre-commit is clean.Checklist
Copyleft License Compliance
🤖 Generated with Claude Code
https://claude.ai/code/session_01AbKqGaeq2q955aBdyQCbxg