Skip to content

Fixes #3192 Fix global DEFAULT quota leak when releasing tasks with an undefined … - #3193

Open
PrithMDP wants to merge 1 commit into
apache:masterfrom
PrithMDP:fix-release-unknown-quota-type
Open

PrithMDP wants to merge 1 commit into
apache:masterfrom
PrithMDP:fix-release-unknown-quota-type

Conversation

@PrithMDP

@PrithMDP PrithMDP commented Oct 14, 2026 •

Copy link
Copy Markdown

Issues

  • My PR addresses the following Helix issues and references them in the PR description:

Fixes #3192

Description

  • Here are some details about my PR, including screenshots of any UI changes:

AssignableInstanceManager.release() only returned quota to _globalThreadBasedQuotaMap when the raw quota type was configured. For a task whose job type is not in the quota config, tryAssign() schedules it as DEFAULT, so assign() decrements the global DEFAULT quota. On release, the raw (undefined) type was not in the map, so nothing was added back. Each such task permanently leaked 1 from global DEFAULT. Eventually hasGlobalCapacity("DEFAULT") returned false, blocking scheduling of DEFAULT and unknown-type jobs until global capacity was recomputed (instance/config change or controller restart).

Fix: release() now treats a null or unconfigured quota type as DEFAULT, mirroring tryAssign(). Per-instance usage in AssignableInstance was already symmetric and is unchanged.

Tests

  • The following tests are written for this issue:

TestAssignableInstanceManagerQuotaRelease

  • testReleaseUndefinedQuotaTypeRestoresGlobalDefault

  • testReleaseNullQuotaTypeRestoresGlobalDefault

  • The following is the result of the "mvn test" command on the appropriate module:

<paste the output of: mvn -pl helix-core test -Dtest=TestAssignableInstanceManagerQuotaRelease>

Changes that Break Backward Compatibility (Optional)

None.

Commits

  • My commits all reference appropriate Apache Helix GitHub issues in their subject lines.

Code Quality

  • My diff has been formatted using helix-style.xml

@PrithMDP PrithMDP changed the title Fix global DEFAULT quota leak when releasing tasks with an undefined … Fixes #3192 Fix global DEFAULT quota leak when releasing tasks with an undefined … Oct 14, 2026
@PrithMDP
PrithMDP force-pushed the fix-release-unknown-quota-type branch from bfc462f to 687a97c Compare October 14, 2026 02:59
@PrithMDP

PrithMDP commented Oct 14, 2026 •

Copy link
Copy Markdown
Author

@narendly @junkaixue can you PTAL? Please let me know if something needs adjusting.

@PrithMDP
PrithMDP force-pushed the fix-release-unknown-quota-type branch from 687a97c to cc5cc0a Compare October 14, 2026 04:52
Comment thread helix-core/src/main/java/org/apache/helix/task/AssignableInstanceManager.java Outdated
@PrithMDP
PrithMDP force-pushed the fix-release-unknown-quota-type branch from cc5cc0a to e558bc3 Compare October 15, 2026 19:44
@PrithMDP
PrithMDP requested a review from junkaixue October 15, 2026 19:49

@junkaixue junkaixue left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm. thanks for contributing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

2 participants