Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 30136b0

Browse filesBrowse files
Akos Kittakittaakos
Akos Kitta
authored andcommitted
Capture and swallow unhandled SIGPIPE signal.
To be able to work around the backend process crash and offline status. Ref: eclipse-theia/theia#8660 Signed-off-by: Akos Kitta <kittaakos@typefox.io>
1 parent 53b06ae commit 30136b0
Copy full SHA for 30136b0

File tree

Expand file treeCollapse file tree

2 files changed

+24
-1
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+24
-1
lines changed

‎arduino-ide-extension/src/node/arduino-ide-backend-module.ts

Copy file name to clipboardExpand all lines: arduino-ide-extension/src/node/arduino-ide-backend-module.ts
+5-1Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { join } from 'path';
44
import { ContainerModule } from 'inversify';
55
import { ArduinoDaemonImpl } from './arduino-daemon-impl';
66
import { ILogger } from '@theia/core/lib/common/logger';
7-
import { BackendApplicationContribution } from '@theia/core/lib/node/backend-application';
7+
import { BackendApplicationContribution, BackendApplication as TheiaBackendApplication } from '@theia/core/lib/node/backend-application';
88
import { LibraryService, LibraryServicePath } from '../common/protocol/library-service';
99
import { BoardsService, BoardsServicePath } from '../common/protocol/boards-service';
1010
import { LibraryServiceImpl } from './library-service-server-impl';
@@ -38,8 +38,12 @@ import { ExecutableServiceImpl } from './executable-service-impl';
3838
import { OutputServicePath, OutputService } from '../common/protocol/output-service';
3939
import { NotificationServiceServerImpl } from './notification-service-server';
4040
import { NotificationServiceServer, NotificationServiceClient, NotificationServicePath } from '../common/protocol';
41+
import { BackendApplication } from './theia/core/backend-application';
4142

4243
export default new ContainerModule((bind, unbind, isBound, rebind) => {
44+
bind(BackendApplication).toSelf().inSingletonScope();
45+
rebind(TheiaBackendApplication).toService(BackendApplication);
46+
4347
// Shared config service
4448
bind(ConfigFileValidator).toSelf().inSingletonScope();
4549
bind(ConfigServiceImpl).toSelf().inSingletonScope();
+19Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { inject, injectable, named } from 'inversify';
2+
import { ContributionProvider } from '@theia/core/lib/common/contribution-provider';
3+
import { BackendApplication as TheiaBackendApplication, BackendApplicationContribution, BackendApplicationCliContribution } from '@theia/core/lib/node/backend-application';
4+
5+
@injectable()
6+
export class BackendApplication extends TheiaBackendApplication {
7+
8+
constructor(
9+
@inject(ContributionProvider) @named(BackendApplicationContribution) protected readonly contributionsProvider: ContributionProvider<BackendApplicationContribution>,
10+
@inject(BackendApplicationCliContribution) protected readonly cliParams: BackendApplicationCliContribution
11+
) {
12+
super(contributionsProvider, cliParams);
13+
// Workaround for Electron not installing a handler to ignore SIGPIPE
14+
// (https://github.com/electron/electron/issues/13254)
15+
// From VS Code: https://github.com/microsoft/vscode/blob/d0c90c9f3ea8d34912194176241503a44b3abd80/src/bootstrap.js#L31-L37
16+
process.on('SIGPIPE', () => console.error(new Error('Unexpected SIGPIPE signal.')));
17+
}
18+
19+
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.