feat(sync): per-resource-type worker cap via --max-workers-per-type#623
Merged
Conversation
7f1b0e3 to
92849d0
Compare
Opt-in CLI flag to cap concurrency per resource type independently of the global --max-workers. Not passing it = unchanged behavior. Shape: --max-workers-per-type 'monitors=20,dashboards=25' Invalid syntax, unknown types, and non-positive values fail-fast at parse.
92849d0 to
ee204f6
Compare
heyronhay
approved these changes
Jul 10, 2026
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.
Summary
Adds an opt-in CLI flag that caps concurrency per resource type independently of global
--max-workers.Some destination endpoints (e.g.
rum_applications,monitors) saturate at lower concurrency than the global default, causing edge/proxy timeout storms. Reducing--max-workersglobally to protect them slows the whole sync. This flag lets operators tighten specific types while leaving others at the global default.Design
--max-workers-per-type "rum_applications=5,monitors=20"— comma-separatedtype=intpairs.--max-workersbehavior. No behavior change for existing users.=, and integer values.Implementation note
The per-type gate mechanism already exists —
ResourceConfig.max_concurrentconstructs anasyncio.Semaphorearound_apply_resource_cb. There was just no CLI hook. This PR wires it throughbuild_config; no changes toWorkersorResourcesHandler.Test plan
tests/unit/test_max_workers_per_type.py(parser layer + apply layer +build_configend-to-end).test_custom_client_trust_env.pythat are unrelated to this PR).resource_config.max_concurrentunchanged.