Skip to content

Marketplace plugin installation blocks the API process and stalls other users #768

Description

@yurongk

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Steps to reproduce

Description

Installing a marketplace plugin currently runs npm install synchronously inside the API request handler.

While the installation is in progress, the Node.js event loop of that API replica is blocked. Other requests routed to the same replica remain pending, causing unrelated pages and users to become unavailable.

With the default single-replica deployment, this can effectively pause the entire API during plugin installation.

Steps to reproduce

  1. Open the plugin marketplace.
  2. Install a plugin that is not already cached.
  3. While the installation request is pending:
    • Open /xpert/w in another tab; or
    • Request /api/health or /api/user/me.
  4. Observe that the new page remains on the clock bootstrap loader and the API requests stay pending.
  5. Once npm install finishes, the pending requests resume.

Expected behavior

Plugin installation may take time, but unrelated API requests should continue to respond normally.

Actual behavior

All requests handled by the same API process are blocked until the synchronous plugin installation finishes or fails.

Root cause

The marketplace installation flow is executed inline:

POST /plugin
  -> PluginManagementService.installPlugin()
  -> registerPluginsAsync()
  -> installOrganizationPlugins()
  -> execSync("npm install ...")

### ✔️ Expected Behavior

_No response_

### ❌ Actual Behavior

_No response_

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions