User Request
Type: bug
Target: Console Application
Submitted by: @aashu2006
Console Request ID: 5f18de6d-b14d-4174-a538-53ed991f19a6
Description
What happened:
In pkg/api/handlers/sse.go:420-433, when the cache is cold, every concurrent SSE request for the same cluster spawns a goroutine that independently calls the Kubernetes API. All of them succeed and all call sseCacheSet with only the last write winning. Under bursty traffic (page loads after deploy), this multiplies Kubernetes API calls by the number of concurrent users.
What I expected:
golang.org/x/sync/singleflight should be used keyed on cacheKey to coalesce concurrent cold fetches into a single Kubernetes API call.
Steps to reproduce:
- Clear the SSE cache
- Send 50 concurrent requests for the same cluster resource
- Observe 50 Kubernetes API calls instead of one
This issue was automatically created from the KubeStellar Console.
User Request
Type: bug
Target: Console Application
Submitted by: @aashu2006
Console Request ID: 5f18de6d-b14d-4174-a538-53ed991f19a6
Description
What happened:
In
pkg/api/handlers/sse.go:420-433, when the cache is cold, every concurrent SSE request for the same cluster spawns a goroutine that independently calls the Kubernetes API. All of them succeed and all callsseCacheSetwith only the last write winning. Under bursty traffic (page loads after deploy), this multiplies Kubernetes API calls by the number of concurrent users.What I expected:
golang.org/x/sync/singleflightshould be used keyed oncacheKeyto coalesce concurrent cold fetches into a single Kubernetes API call.Steps to reproduce:
This issue was automatically created from the KubeStellar Console.