Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[plug-in] Improve plugin node.js error handling #5695

Merged
merged 1 commit into from
Jul 12, 2019

Conversation

evidolob
Copy link
Contributor

@evidolob evidolob commented Jul 11, 2019

This PR do next:

  • Improve logging error and exit events on plugin runtime node.js instance.
  • Disable exit and crash function in plugin runtime node.js instance, so plugin cannot terminate it's runtime.
  • Add handling of unhandledRejection and uncaughtException events inside plugin runtime.
  • Add notification, if plugin runtime terminated unexpectedly.

This PR can be tested with this plugin bad-theia-plugin, it contains 3 commands with Bad prefix.

@evidolob evidolob added the plug-in system issues related to the plug-in system label Jul 11, 2019
@evidolob evidolob requested a review from benoitf July 11, 2019 11:25
@evidolob evidolob self-assigned this Jul 11, 2019
Copy link
Contributor

@benoitf benoitf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

works as expected with plugin sample

badplugin

@evidolob evidolob merged commit 5b48e66 into master Jul 12, 2019
@evidolob evidolob deleted the plugin-runtime-error-handling branch July 12, 2019 08:26
@@ -19,6 +19,54 @@ import { RPCProtocolImpl } from '../../api/rpc-protocol';
import { PluginHostRPC } from './plugin-host-rpc';
console.log('PLUGIN_HOST(' + process.pid + ') starting instance');

// override exit() function, to do not allow plugin kill this node
Copy link
Member

@akosyakov akosyakov Jul 12, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What node? Do you mean that a single plugin should not kill the plugin host process by calling process.ext? nvm will assume that it meant to be node process

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plug-in system issues related to the plug-in system
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants