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/bugSomething isn't working
    priority/important-soonMust be staffed and worked on either currently, or very soon, ideally in time for the next release.
    area/data-passingInputs, outputs, parameterKey and the workflow context store (pkg/hooks, pkg/context)
    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-passingInputs, outputs, parameterKey and the workflow context store (pkg/hooks, pkg/context)good first issueGood for newcomerspriority/important-soonMust be staffed and worked on either currently, or very soon, ideally in time for the next release.type/bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions