Prevents single-tenant overload from exhausting shared DB connection … - #3345
Draft
vasilchev wants to merge 1 commit into
Draft
Prevents single-tenant overload from exhausting shared DB connection …#3345vasilchev wants to merge 1 commit into
vasilchev wants to merge 1 commit into
Conversation
vasilchev
force-pushed
the
throttle/tenants
branch
3 times, most recently
from
September 10, 2026 18:44
bf961f1 to
12f9dab
Compare
…pool. Enforces fair-share admission control with contention-aware bursting. ### What Changed **New components:** - `TenantThrottle` — fair-share gate (hawkbit-core) - `ThrottlingDataSourceDecorator` — JDBC interception layer (hawkbit-autoconfigure) - `ConnectionThrottleGate` — permit lifecycle tied to connection close - REST exception mapper → HTTP 429 with Retry-After **Modified:** - DataSource wrapped via `BeanPostProcessor` when enabled - System work (no tenant context) exempt - Nested transactions (REQUIRES_NEW) bypass reentrancy ### Configuration Modes #### 1. **No Throttle** (current default) ```properties hawkbit.throttle.enabled=false DataSource untouched. Zero behavior change. 2. Hard Cap (strict limit, fast-reject) hawkbit.throttle.enabled=true hawkbit.throttle.limit=5 # each tenant max 5 concurrent connections hawkbit.throttle.timeout=0 # reject immediately when over limit hawkbit.throttle.threshold=-1 # no threshold (always enforce limit) Behavior: Tenant holding 5 connections → 6th request gets HTTP 429 instantly. Other tenants unaffected. Safe on platform threads. 3. Contention-Aware Burst (threshold + backpressure) hawkbit.throttle.enabled=true hawkbit.throttle.limit=10 # ceiling per tenant hawkbit.throttle.timeout=20s # wait up to 20s before 429 hawkbit.throttle.threshold=8 # fairness kicks in at 8/10 pool utilization spring.threads.virtual.enabled=true # REQUIRED for timeout>0 Signed-off-by: vasilchev <vasil.ilchev@bosch.com>
vasilchev
force-pushed
the
throttle/tenants
branch
from
September 10, 2026 23:36
12f9dab to
797f4f5
Compare
vasilchev
marked this pull request as draft
September 10, 2026 23:50
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.
…pool. Enforces fair-share admission control with contention-aware bursting.
What Changed
New components:
TenantThrottle— fair-share gate (hawkbit-core)ThrottlingDataSourceDecorator— JDBC interception layer (hawkbit-autoconfigure)ConnectionThrottleGate— permit lifecycle tied to connection closeModified:
BeanPostProcessorwhen enabledConfiguration Modes
1. No Throttle (current default)