You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@helix.apache.org by "PrithMDP (via GitHub)" <gi...@apache.org> on 2026/10/14 02:13:31 UTC

[I] AssignableInstanceManager.release() leaks global DEFAULT quota for tasks with an unknown job type [helix]

PrithMDP opened a new issue, #3192:
URL: https://github.com/apache/helix/issues/3192

   ### Description
   When a job's type (quota type) is not defined in the cluster's task quota config, the assign and release paths in `AssignableInstanceManager` are asymmetric. Each task deducts 1 from the global `DEFAULT` quota on assign but never returns it on release, so the global DEFAULT capacity leaks.
   
   ### Root cause
   - Assign: `AssignableInstance.tryAssign` rewrites an unknown quota type to `DEFAULT`, so the `TaskAssignResult` carries `DEFAULT`. `AssignableInstanceManager.assign` (~L538-541) then decrements `_globalThreadBasedQuotaMap["DEFAULT"]`.
   - Release: `AssignableInstanceManager.release` (~L505-507) increments the global map only `if (_globalThreadBasedQuotaMap.containsKey(quotaType))`. `quotaType` is the raw `jobConfig.getJobType()` passed by `AbstractTaskDispatcher` (L157, 636, 706, 1017). An unknown type is not in the map, so nothing is returned. Only `null` is normalized to DEFAULT.
   
   Per-instance usage (`AssignableInstance.assign/release`) is symmetric: both fall back to DEFAULT.
   
   ### Impact
   Each task of an unknown job type permanently reduces global DEFAULT capacity by 1. Eventually `hasGlobalCapacity("DEFAULT")` (used in `AbstractTaskDispatcher` ~L1211) returns false, which blocks scheduling of DEFAULT and unknown-type jobs until `computeGlobalThreadBasedCapacity()` recomputes (instance or config change, or controller restart).
   
   ### Suggested fix
   Normalize in `AssignableInstanceManager.release`, as `tryAssign` does:
   
       if (quotaType == null || !_globalThreadBasedQuotaMap.containsKey(quotaType)) {
         quotaType = AssignableInstance.DEFAULT_QUOTA_TYPE;
       }
   
   Alternatively, release using `_taskAssignResultMap.get(taskId).getQuotaType()` so release always mirrors what assign deducted.
   
   ### Repro (from code reading, not yet run)
   1. Configure quota types without `foo` (e.g. DEFAULT only).
   2. Assign a task whose job type is `foo`; global DEFAULT decrements by 1.
   3. Release the task; global DEFAULT does not increment.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org


Re: [I] AssignableInstanceManager.release() leaks global DEFAULT quota for tasks with an unknown job type [helix]

Posted by "junkaixue (via GitHub)" <gi...@apache.org>.
junkaixue closed issue #3192: AssignableInstanceManager.release() leaks global DEFAULT quota for tasks with an unknown job type
URL: https://github.com/apache/helix/issues/3192


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org