Skip to content

Commit 26fdc57

Browse files
authored
Prevent accidental restoration of manual limit. (#29)
1 parent 9e940f5 commit 26fdc57

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

balancer/balancer/balancer.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1583,6 +1583,13 @@ def set_resource_limit(
15831583
for extra_id in extra_effective_ids:
15841584
self.io_ctl.set_disk_io_throttle(extra_id, limits=limits)
15851585

1586+
# Manual limits go to g_limited_apps_manual and should NOT be auto-restored.
1587+
# Remove from g_limited_apps if it was previously auto-limited to prevent
1588+
# the monitoring loop from auto-restoring a manually-limited app.
1589+
if effective_app_id in g_limited_apps:
1590+
g_limited_apps.pop(effective_app_id, None)
1591+
logger.info(f"Removed {app_name} from auto-limited apps (now manually limited)")
1592+
15861593
# 6. Record the limit state (as long as at least one limit succeeded)
15871594
if resource_limited or io_limited:
15881595
g_limited_apps_manual[effective_app_id] = (app_name, limit_rates, {

0 commit comments

Comments
 (0)