openshift / openshift/hypershift
deletePairConfigMaps can return an error if a listed ConfigMap is already gone
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 541
- Forks
- 567
- Avg merge
- 5d 13h
- Merged PRs (30d)
- 136
Description
Hi HyperShift maintainers,
While looking at the dedicated request-serving cleanup path, I noticed that deletePairConfigMaps lists matching ConfigMaps and then deletes each one, but it appears to return any Delete error directly.
The helper lists pair ConfigMaps in the placeholder namespace:
dedicated_request_serving_nodes.go:422-L428
It then deletes the ConfigMaps whose data points back to the HostedCluster:
dedicated_request_serving_nodes.go:429-L433
This cleanup runs during HostedCluster deletion before the scheduler finalizer is removed:
dedicated_request_serving_nodes.go:529-L545
The race I am wondering about is:
reconcile A lists a pair ConfigMap for the HostedCluster
reconcile B or another cleanup path deletes that ConfigMap
reconcile A calls Delete on the stale listed object
Delete returns NotFound
handleDeletion returns the error before removing the scheduler finalizer
For this kind of list-then-delete cleanup, NotFound after the list is usually an idempotent success: the desired cleanup state has already been reached. Returning the error can make the deletion path fail for a transient stale-list race and delay finalizer removal until a later reconcile.
Would it make sense to ignore apierrors.IsNotFound(err) around this r.Delete call, similar to other Kubernetes cleanup paths that treat an already-deleted object as success?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in hypershift-operator/controllers/scheduler/aws/dedicated_request_serving_nodes.go at deletePairConfigMaps, then read the handleDeletion path around lines 529-545. Trace the list-then-delete cleanup and verify that a ConfigMap disappearing after the list no longer delays scheduler finalizer removal, while other delete errors remain visible.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, kubernetes
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 76/100