Skip to content

Old plugin code remains loaded after updating a plugin without restarting the server #738

Description

@tiven-w

Description

When a plugin is updated or upgraded while the server keeps running, the previous plugin implementation still appears to remain active inside the same Node.js process. The new plugin code is loaded as an additional dynamic module instead of fully replacing or disposing the old one.

As a result, multiple dynamic modules/versions for the same plugin can coexist in the Node.js process.

Steps to Reproduce

  1. Start the server with an installed plugin.
  2. Update or upgrade that plugin.
  3. Do not restart the server.
  4. Observe the Node.js process/runtime modules.

Actual Behavior

  • The old plugin program continues running in the Node.js process.
  • The upgraded plugin is loaded alongside the old plugin code.
  • Multiple dynamic modules for the same plugin may coexist.
  • This can lead to duplicated handlers, stale logic, inconsistent state, memory leaks, or unexpected behavior.

Expected Behavior

Updating/upgrading a plugin should either:

  • properly stop, dispose, and unload the old plugin runtime before loading the new version; or
  • clearly require/enforce a server restart when hot plugin replacement is not supported.

Suggested Direction

Consider adding a plugin lifecycle cleanup step during upgrade, including disposal of background tasks, event listeners, registered handlers, and dynamic module references. If dynamic unloading is not reliable in Node.js, the upgrade flow should mark the server as requiring a restart or block hot replacement.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Fields

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions