You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using vscode-ws-jsonrpc with Che-Theia.
It gets sporadically connection failures by "Connection got disposed" error from vscode-jsonrpc.
The stack trace is like this.
2020-09-12 07:11:55.100 root ERROR Error: Connection got disposed.
at Object.dispose (/home/theia/node_modules/vscode-jsonrpc/lib/main.js:904:25)
at /home/theia/node_modules/vscode-ws-jsonrpc/lib/socket/connection.js:14:41
at CallbackList.invoke (/home/theia/node_modules/vscode-jsonrpc/lib/events.js:62:39)
at Emitter.fire (/home/theia/node_modules/vscode-jsonrpc/lib/events.js:121:36)
at closeHandler (/home/theia/node_modules/vscode-jsonrpc/lib/main.js:240:26)
at CallbackList.invoke (/home/theia/node_modules/vscode-jsonrpc/lib/events.js:62:39)
at Emitter.fire (/home/theia/node_modules/vscode-jsonrpc/lib/events.js:121:36)
at WebSocketMessageReader.fireClose (/home/theia/node_modules/vscode-jsonrpc/lib/messageReader.js:111:27)
at WebSocketMessageReader.fireClose (/home/theia/node_modules/vscode-ws-jsonrpc/lib/socket/reader.js:67:19)
at /home/theia/node_modules/vscode-ws-jsonrpc/lib/socket/reader.js:24:18
I googled and I found a lot of "Connection displosed" issue in VSCode comminity.
So I suspect this is caused by bugs in vscode-ws-jsonrpc.
In the other hands, I suppose this can be avoid by writing a workaround code.
My suggestion is like this. Is it acceptable?
protected fireClose(): void {
if (this.state === 'initial') {
this.events.splice(0, 0, {});
} else if (this.state === 'listening') {
- super.fireClose();+ try {+ super.fireClose();+ } catch (e) { console.error(e); /* Ignore as the connection may be disposed. */ }
}
this.state = 'closed';
}
I'm using
vscode-ws-jsonrpcwith Che-Theia.It gets sporadically connection failures by "Connection got disposed" error from
vscode-jsonrpc.The stack trace is like this.
I googled and I found a lot of "Connection displosed" issue in VSCode comminity.
So I suspect this is caused by bugs in
vscode-ws-jsonrpc.In the other hands, I suppose this can be avoid by writing a workaround code.
My suggestion is like this. Is it acceptable?
protected fireClose(): void { if (this.state === 'initial') { this.events.splice(0, 0, {}); } else if (this.state === 'listening') { - super.fireClose(); + try { + super.fireClose(); + } catch (e) { console.error(e); /* Ignore as the connection may be disposed. */ } } this.state = 'closed'; }