Skip to content

Log spam during namespace termination #300

Description

@cardil

Bug

When a namespace containing MCPServers is deleted, the operator produces ERROR-level log lines with full stack traces. The reconciler does not check if the namespace is terminating before attempting resource creation.

In testing (20 create/delete cycles with 3 MCPServers per cycle), 1263 error log lines were produced, all the same pattern:

"Failed to create NetworkPolicy" ... "unable to create new content
in namespace mcplo-soak-2 because it is being terminated"
"Reconciler error" ... same terminating namespace message

Fix

Add an early return at the top of Reconcile when the namespace has DeletionTimestamp set, or when the MCPServer itself is being deleted. This prevents unnecessary resource creation attempts and error logging in dying namespaces.

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugCategorizes issue or PR as related to a bug.triage/acceptedIndicates an issue or PR is ready to be actively worked on.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions