Skip to content

fix: NameError in ResourcePoolScaling.manage() fallback path#155

Merged
jkupferer merged 1 commit into
mainfrom
fix/resourcepoolscaling-name-error
May 9, 2026
Merged

fix: NameError in ResourcePoolScaling.manage() fallback path#155
jkupferer merged 1 commit into
mainfrom
fix/resourcepoolscaling-name-error

Conversation

@rut31337

@rut31337 rut31337 commented May 9, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Fix undefined variable nameself.resource_pool_name in ResourcePoolScaling.manage() line 105

Problem

When ResourcePool.get() returns None (cache miss), the fallback fetch on line 105 references an undefined variable name:

resource_pool = await ResourcePool.fetch(name=name, namespace=Poolboy.namespace)

This raises NameError: name 'name' is not defined and crashes the handler on every retry (60s interval). All ResourcePoolScaling operations are blocked, preventing shared cluster pools from scaling up.

Impact on production (ocp-us-west-2): 4 ResourcePoolScaling objects stuck in waiting state with 1,050+ retries, blocking pool provisioning for multiple Summit 2026 labs.

Fix

-            resource_pool = await ResourcePool.fetch(name=name, namespace=Poolboy.namespace)
+            resource_pool = await ResourcePool.fetch(name=self.resource_pool_name, namespace=Poolboy.namespace)

Why it wasn't caught earlier

The bug is on a fallback path — ResourcePool.get() on line 103 normally succeeds from the in-memory cache, so line 105 is rarely reached. It only triggers when the cache misses, e.g., after operator restart or when a new ResourcePoolScaling is created before the ResourcePool is cached.

…back

The fallback path in manage() when ResourcePool.get() returns None
references an undefined variable `name` instead of `self.resource_pool_name`.
This causes a NameError that crashes the handler on every retry.

The bug is masked when ResourcePool.get() succeeds from cache (line 103),
but when the cache misses, the fallback on line 105 always fails:

    NameError: name 'name' is not defined. Did you mean: 'self.name'?

This blocks all ResourcePoolScaling operations, preventing shared cluster
pools from scaling up.
@jkupferer jkupferer merged commit 0edf8e8 into main May 9, 2026
2 of 3 checks passed
@jkupferer jkupferer deleted the fix/resourcepoolscaling-name-error branch May 9, 2026 19:55
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.

2 participants