Skip to content

Server.Shutdown() never calls StopSSECacheEvictor() leaking the evictor goroutine after shutdown #7043

@aashu2006

Description

@aashu2006

User Request

Type: bug
Target: Console Application
Submitted by: @aashu2006
Console Request ID: d156ecd0-dfdf-45ae-9b1b-5047f367017f

Description

What happened:
In pkg/api/server.go:1301-1338, Server.Shutdown() calls hub.Close(), k8sClient.StopWatching(), bridge.Stop(), store.Close(), and app.Shutdown() but never calls StopSSECacheEvictor(). The function's docstring explicitly says it is "Intended for server shutdown" but it is never invoked. The evictor goroutine runs indefinitely after server shutdown.

What I expected:
StopSSECacheEvictor() should be called in Server.Shutdown() alongside the other cleanup calls.

Steps to reproduce:

  1. Start the server and trigger any SSE stream (populates the cache)
  2. Shut down the server
  3. Observe the SSE cache evictor goroutine continues running after shutdown

This issue was automatically created from the KubeStellar Console.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ai-fix-requestedai-processingAI is currently processing this issuekind/bugCategorizes issue or PR as related to a bug.triage/acceptedIndicates an issue or PR is ready to be actively worked on.triage/neededNeeds triage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions