Skip to content

[Bug] DeleteInMemoryContext never removes anything, so in-memory contexts pile up #333

Closed

Description

@briankane

Describe the bug

With the in-memory workflow context on (EnableInMemoryContext, KubeVela's
--optimize-enable-in-memory-workflow-context), contexts are stored under <namespace>/workflow-<name>-context
(contextKey in pkg/context/storage.go), but DeleteInMemoryContext(appName) deletes
workflow-<name>-context, with no namespace. The keys never match, so nothing is ever removed.

KubeVela calls it when an Application is deleted (application_controller.go), so every deleted
Application's context stays in memory for the life of the controller.

To reproduce

Store a context for ns/app with GetOrCreateInMemoryContext, then call DeleteInMemoryContext("app");
GetInMemoryContext("app", "ns") still returns it.

Expected behavior

Delete takes the namespace and removes the same key the store wrote, with a test that a deleted context
is gone. The KubeVela call site passes app.Namespace.

Additional context

Found reviewing #262; unchanged by it. Repos: kubevela/workflow (fix), kubevela/kubevela (call site, after a bump).

Activity

  1. added
    type/bug
    good first issue
    priority/important-soon
    area/data-passing
    on Nov 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/data-passinggood first issuepriority/important-soontype/bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions