Skip to content

late code injection #37440

Description

@gireeshpunathil

Is your feature request related to a problem? Please describe.

Currently, a node process cannot receive and execute custom code after it has started. For monitoring tools, a common use case is to be able to attach to an arbitrary process, inject a (tracing) code, instruct the runtime to execute that, and optionally detach from the process.

Describe the solution you'd like

  • define a mechanism to interrupt the runtime (signals in platforms where supported)
  • specify a Javascript interface for the code injection:
    • the signal is delegated to a Javascript handler function
    • a module with a predefined name (such as agent) is loaded
    • a function with a predefined name (such as execute) is executed
    • a user can define this module and place it in the search path, prior to signalling
    • upon completion, the module is unloaded
  • define security restrictions (only requests from matching UID / GID allowed)

Describe alternatives you've considered

  • modify the application and integrate with the monitoring tools
  • define a specific function in the application that receives code at runtime

Activity

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

    feature requestIssues requesting new Node.js features.staleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions